Fix Python3 Errors in Azure Cloud Module
When using Python3, the exec_module function errors out with a unsupported operand type(s) for +: 'dict_keys' and 'list' error when adding the .keys() to a static list. Use the explicit list function to make a list of keys and then add to the ['tags'] list.
This commit is contained in:
parent
9500aac5b9
commit
171d903d04
9 changed files with 9 additions and 9 deletions
|
@ -451,7 +451,7 @@ class AzureRMDeploymentManager(AzureRMModuleBase):
|
|||
if PREREQ_IMPORT_ERROR:
|
||||
self.fail(PREREQ_IMPORT_ERROR)
|
||||
|
||||
for key in self.module_arg_spec.keys() + ['tags']:
|
||||
for key in list(self.module_arg_spec.keys()) + ['tags']:
|
||||
setattr(self, key, kwargs[key])
|
||||
|
||||
if self.state == 'present':
|
||||
|
|
|
@ -336,7 +336,7 @@ class AzureRMNetworkInterface(AzureRMModuleBase):
|
|||
|
||||
def exec_module(self, **kwargs):
|
||||
|
||||
for key in self.module_arg_spec.keys() + ['tags']:
|
||||
for key in list(self.module_arg_spec.keys()) + ['tags']:
|
||||
setattr(self, key, kwargs[key])
|
||||
|
||||
results = dict()
|
||||
|
|
|
@ -182,7 +182,7 @@ class AzureRMPublicIPAddress(AzureRMModuleBase):
|
|||
|
||||
def exec_module(self, **kwargs):
|
||||
|
||||
for key in self.module_arg_spec.keys() + ['tags']:
|
||||
for key in list(self.module_arg_spec.keys()) + ['tags']:
|
||||
setattr(self, key, kwargs[key])
|
||||
|
||||
results = dict()
|
||||
|
|
|
@ -153,7 +153,7 @@ class AzureRMResourceGroup(AzureRMModuleBase):
|
|||
|
||||
def exec_module(self, **kwargs):
|
||||
|
||||
for key in self.module_arg_spec.keys() + ['tags']:
|
||||
for key in list(self.module_arg_spec.keys()) + ['tags']:
|
||||
setattr(self, key, kwargs[key])
|
||||
|
||||
results = dict()
|
||||
|
|
|
@ -548,7 +548,7 @@ class AzureRMSecurityGroup(AzureRMModuleBase):
|
|||
|
||||
def exec_module(self, **kwargs):
|
||||
|
||||
for key in self.module_arg_spec.keys() + ['tags']:
|
||||
for key in list(self.module_arg_spec.keys()) + ['tags']:
|
||||
setattr(self, key, kwargs[key])
|
||||
|
||||
changed = False
|
||||
|
|
|
@ -206,7 +206,7 @@ class AzureRMStorageAccount(AzureRMModuleBase):
|
|||
|
||||
def exec_module(self, **kwargs):
|
||||
|
||||
for key in self.module_arg_spec.keys() + ['tags']:
|
||||
for key in list(self.module_arg_spec.keys()) + ['tags']:
|
||||
setattr(self, key, kwargs[key])
|
||||
|
||||
resource_group = self.get_resource_group(self.resource_group)
|
||||
|
|
|
@ -267,7 +267,7 @@ class AzureRMStorageBlob(AzureRMModuleBase):
|
|||
|
||||
def exec_module(self, **kwargs):
|
||||
|
||||
for key in self.module_arg_spec.keys() + ['tags']:
|
||||
for key in list(self.module_arg_spec.keys()) + ['tags']:
|
||||
setattr(self, key, kwargs[key])
|
||||
|
||||
self.results['check_mode'] = self.check_mode
|
||||
|
|
|
@ -555,7 +555,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase):
|
|||
|
||||
def exec_module(self, **kwargs):
|
||||
|
||||
for key in self.module_arg_spec.keys() + ['tags']:
|
||||
for key in list(self.module_arg_spec.keys()) + ['tags']:
|
||||
setattr(self, key, kwargs[key])
|
||||
|
||||
# make sure options are lower case
|
||||
|
|
|
@ -221,7 +221,7 @@ class AzureRMVirtualNetwork(AzureRMModuleBase):
|
|||
|
||||
def exec_module(self, **kwargs):
|
||||
|
||||
for key in self.module_arg_spec.keys() + ['tags']:
|
||||
for key in list(self.module_arg_spec.keys()) + ['tags']:
|
||||
setattr(self, key, kwargs[key])
|
||||
|
||||
self.results['check_mode'] = self.check_mode
|
||||
|
|
Loading…
Reference in a new issue