From af2e5fc761ab9fcfe95199a1e906736f13cdeab2 Mon Sep 17 00:00:00 2001 From: Zim Kalinowski Date: Fri, 29 Mar 2019 14:43:18 +0800 Subject: [PATCH] Renaming inconsistent module name (#54513) --- .../azure/_azure_rm_virtualmachine_extension.py | 1 + ...ension.py => azure_rm_virtualmachineextension.py} | 12 +++++++++--- .../aliases | 0 .../meta/main.yml | 0 .../tasks/main.yml | 4 ++-- 5 files changed, 12 insertions(+), 5 deletions(-) create mode 120000 lib/ansible/modules/cloud/azure/_azure_rm_virtualmachine_extension.py rename lib/ansible/modules/cloud/azure/{azure_rm_virtualmachine_extension.py => azure_rm_virtualmachineextension.py} (95%) rename test/integration/targets/{azure_rm_virtualmachine_extension => azure_rm_virtualmachineextension}/aliases (100%) rename test/integration/targets/{azure_rm_virtualmachine_extension => azure_rm_virtualmachineextension}/meta/main.yml (100%) rename test/integration/targets/{azure_rm_virtualmachine_extension => azure_rm_virtualmachineextension}/tasks/main.yml (98%) diff --git a/lib/ansible/modules/cloud/azure/_azure_rm_virtualmachine_extension.py b/lib/ansible/modules/cloud/azure/_azure_rm_virtualmachine_extension.py new file mode 120000 index 00000000000..6265701b299 --- /dev/null +++ b/lib/ansible/modules/cloud/azure/_azure_rm_virtualmachine_extension.py @@ -0,0 +1 @@ +azure_rm_virtualmachineextension.py \ No newline at end of file diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_extension.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachineextension.py similarity index 95% rename from lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_extension.py rename to lib/ansible/modules/cloud/azure/azure_rm_virtualmachineextension.py index aa3e358c112..163f7f7dc3a 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine_extension.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachineextension.py @@ -15,7 +15,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', DOCUMENTATION = ''' --- -module: azure_rm_virtualmachine_extension +module: azure_rm_virtualmachineextension version_added: "2.4" @@ -24,6 +24,9 @@ short_description: Managed Azure Virtual Machine extension description: - Create, update and delete Azure Virtual Machine Extension +notes: + - This module was called C(azure_rm_virtualmachine_extension) before Ansible 2.8. The usage did not change. + options: resource_group: description: @@ -77,7 +80,7 @@ author: EXAMPLES = ''' - name: Create VM Extension - azure_rm_virtualmachine_extension: + azure_rm_virtualmachineextension: name: myvmextension location: eastus resource_group: myResourceGroup @@ -89,7 +92,7 @@ EXAMPLES = ''' auto_upgrade_minor_version: true - name: Delete VM Extension - azure_rm_virtualmachine_extension: + azure_rm_virtualmachineextension: name: myvmextension location: eastus resource_group: myResourceGroup @@ -208,6 +211,9 @@ class AzureRMVMExtension(AzureRMModuleBase): for key in list(self.module_arg_spec.keys()): setattr(self, key, kwargs[key]) + if self.module._name == 'azure_rm_virtualmachine_extension': + self.module.deprecate("The 'azure_rm_virtualmachine_extension' module has been renamed to 'azure_rm_virtualmachineextension'", version='2.12') + resource_group = None response = None to_be_updated = False diff --git a/test/integration/targets/azure_rm_virtualmachine_extension/aliases b/test/integration/targets/azure_rm_virtualmachineextension/aliases similarity index 100% rename from test/integration/targets/azure_rm_virtualmachine_extension/aliases rename to test/integration/targets/azure_rm_virtualmachineextension/aliases diff --git a/test/integration/targets/azure_rm_virtualmachine_extension/meta/main.yml b/test/integration/targets/azure_rm_virtualmachineextension/meta/main.yml similarity index 100% rename from test/integration/targets/azure_rm_virtualmachine_extension/meta/main.yml rename to test/integration/targets/azure_rm_virtualmachineextension/meta/main.yml diff --git a/test/integration/targets/azure_rm_virtualmachine_extension/tasks/main.yml b/test/integration/targets/azure_rm_virtualmachineextension/tasks/main.yml similarity index 98% rename from test/integration/targets/azure_rm_virtualmachine_extension/tasks/main.yml rename to test/integration/targets/azure_rm_virtualmachineextension/tasks/main.yml index 4a6691d734b..7e80f7cac0c 100644 --- a/test/integration/targets/azure_rm_virtualmachine_extension/tasks/main.yml +++ b/test/integration/targets/azure_rm_virtualmachineextension/tasks/main.yml @@ -68,7 +68,7 @@ version: latest - name: Create VM Extension - azure_rm_virtualmachine_extension: + azure_rm_virtualmachineextension: resource_group: "{{ resource_group }}" name: testVMExtension virtual_machine_name: testVM @@ -125,7 +125,7 @@ - results.extensions[0]['provisioning_state'] != None - name: Delete VM Extension - azure_rm_virtualmachine_extension: + azure_rm_virtualmachineextension: resource_group: "{{ resource_group }}" name: testVMExtension virtual_machine_name: testVM