mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ported iterkeys to py3 syntax (#5657)
* ported iterkeys to py3 syntax Addresses ansible/ansible#18507 * Use ansible.module_utils.six.moves iterkeys instead of dict.keys() * Removed 'iterkeys'
This commit is contained in:
parent
c0c26f83a8
commit
48d47a57d5
1 changed files with 4 additions and 3 deletions
|
@ -19,6 +19,7 @@
|
|||
# TODO:
|
||||
# Ability to set CPU/Memory reservations
|
||||
|
||||
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
|
@ -983,7 +984,7 @@ def reconfigure_vm(vsphere_client, vm, module, esxi, resource_pool, cluster_name
|
|||
disk_num = 0
|
||||
dev_changes = []
|
||||
disks_changed = {}
|
||||
for disk in sorted(vm_disk.iterkeys()):
|
||||
for disk in sorted(vm_disk):
|
||||
try:
|
||||
disksize = int(vm_disk[disk]['size_gb'])
|
||||
# Convert the disk size to kilobytes
|
||||
|
@ -1339,7 +1340,7 @@ def create_vm(vsphere_client, module, esxi, resource_pool, cluster_name, guest,
|
|||
if vm_disk:
|
||||
disk_num = 0
|
||||
disk_key = 0
|
||||
for disk in sorted(vm_disk.iterkeys()):
|
||||
for disk in sorted(vm_disk):
|
||||
try:
|
||||
datastore = vm_disk[disk]['datastore']
|
||||
except KeyError:
|
||||
|
@ -1395,7 +1396,7 @@ def create_vm(vsphere_client, module, esxi, resource_pool, cluster_name, guest,
|
|||
add_floppy(module, vsphere_client, config_target, config, devices,
|
||||
default_devs, floppy_type, floppy_image_path)
|
||||
if vm_nic:
|
||||
for nic in sorted(vm_nic.iterkeys()):
|
||||
for nic in sorted(vm_nic):
|
||||
try:
|
||||
nictype = vm_nic[nic]['type']
|
||||
except KeyError:
|
||||
|
|
Loading…
Reference in a new issue