mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Fix incorrect use of is
for comparisons.
See https://bugs.python.org/issue34850 for details.
This commit is contained in:
parent
cd7a144515
commit
0a461380a3
21 changed files with 42 additions and 42 deletions
|
@ -923,7 +923,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase):
|
|||
if set(current_nics) != set(network_interfaces):
|
||||
self.log('CHANGED: virtual machine {0} - network interfaces are different.'.format(self.name))
|
||||
differences.append('Network Interfaces')
|
||||
updated_nics = [dict(id=id, primary=(i is 0))
|
||||
updated_nics = [dict(id=id, primary=(i == 0))
|
||||
for i, id in enumerate(network_interfaces)]
|
||||
vm_dict['properties']['networkProfile']['networkInterfaces'] = updated_nics
|
||||
changed = True
|
||||
|
@ -1067,7 +1067,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase):
|
|||
if not self.short_hostname:
|
||||
self.short_hostname = self.name
|
||||
|
||||
nics = [self.compute_models.NetworkInterfaceReference(id=id, primary=(i is 0))
|
||||
nics = [self.compute_models.NetworkInterfaceReference(id=id, primary=(i == 0))
|
||||
for i, id in enumerate(network_interfaces)]
|
||||
|
||||
# os disk
|
||||
|
@ -1217,7 +1217,7 @@ class AzureRMVirtualMachine(AzureRMModuleBase):
|
|||
|
||||
self.log("Update virtual machine {0}".format(self.name))
|
||||
self.results['actions'].append('Updated VM {0}'.format(self.name))
|
||||
nics = [self.compute_models.NetworkInterfaceReference(id=interface['id'], primary=(i is 0))
|
||||
nics = [self.compute_models.NetworkInterfaceReference(id=interface['id'], primary=(i == 0))
|
||||
for i, interface in enumerate(vm_dict['properties']['networkProfile']['networkInterfaces'])]
|
||||
|
||||
# os disk
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue