From 0d9392a3bcf713f683cf22ccfdc6ea5e321fffc1 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Wed, 4 Jan 2017 10:12:29 +0100 Subject: [PATCH] vmware_guest: import iteritems (#19821) Without this change you get this on Python 2.7.5: NameError: global name 'iteritems' is not defined --- .../modules/cloud/vmware/vmware_guest.py | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest.py b/lib/ansible/modules/cloud/vmware/vmware_guest.py index 82f51187355..c464e339436 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest.py @@ -327,6 +327,16 @@ instance: sample: None """ +import os +import time +from netaddr import IPNetwork, IPAddress + +# import module snippets +from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.six import iteritems +from ansible.module_utils.urls import fetch_url +from ansible.module_utils.vmware import get_all_objs, connect_to_api + try: import json except ImportError: @@ -341,13 +351,6 @@ try: except ImportError: pass -import os -import time -from netaddr import IPNetwork, IPAddress - -from ansible.module_utils.urls import fetch_url - - class PyVmomiDeviceHelper(object): """ This class is a helper to create easily VMWare Objects for PyVmomiHelper """ @@ -1715,9 +1718,5 @@ def main(): else: module.exit_json(**result) - -from ansible.module_utils.vmware import * -from ansible.module_utils.basic import * - if __name__ == '__main__': main()