mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-10 14:05:07 +00:00
xenserver_guest: fix code style caught by codeqa (#11721)
* xenserver_guest: fix code style caught by codeqa * add changelog frag
This commit is contained in:
parent
d956fb8197
commit
08442186e6
2 changed files with 3 additions and 4 deletions
2
changelogs/fragments/11721-xenserver-guest-codeqa.yml
Normal file
2
changelogs/fragments/11721-xenserver-guest-codeqa.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
minor_changes:
|
||||
- xenserver_guest - use ``enumerate()`` instead of manual index variable in ``for`` loop (https://github.com/ansible-collections/community.general/pull/11721).
|
||||
|
|
@ -938,9 +938,7 @@ class XenServerVM(XenServerObject):
|
|||
)[0]
|
||||
self.xapi_session.xenapi.VBD.insert(cdrom_vbd_ref, cdrom_vdi_ref)
|
||||
elif change.get("networks_changed"):
|
||||
position = 0
|
||||
|
||||
for network_change_list in change["networks_changed"]:
|
||||
for position, network_change_list in enumerate(change["networks_changed"]):
|
||||
if network_change_list:
|
||||
vm_vif_params = self.vm_params["VIFs"][position]
|
||||
network_params = self.module.params["networks"][position]
|
||||
|
|
@ -1113,7 +1111,6 @@ class XenServerVM(XenServerObject):
|
|||
network_params[network_change],
|
||||
)
|
||||
|
||||
position += 1
|
||||
elif change.get("networks_new"):
|
||||
for position, vif_device in change["networks_new"]:
|
||||
network_params = self.module.params["networks"][position]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue