VMware: remove unused imports (#43804)

Idea taken from https://github.com/ansible/ansible/pull/43402

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/36818/merge
Abhijeet Kasurde 6 years ago committed by GitHub
parent 1decbb92fc
commit e364d717cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,7 +9,7 @@
# TODO:
# * more jq examples
# * optional folder heriarchy
# * optional folder hierarchy
"""
$ jq '._meta.hostvars[].config' data.json | head
@ -38,9 +38,8 @@ import sys
import uuid
from time import time
import six
from jinja2 import Environment
from six import integer_types, string_types
from six import integer_types, PY3
from six.moves import configparser
try:
@ -235,7 +234,7 @@ class VMWareInventory(object):
'groupby_custom_field': False}
}
if six.PY3:
if PY3:
config = configparser.ConfigParser()
else:
config = configparser.SafeConfigParser()

@ -128,7 +128,7 @@ result:
'''
try:
from pyVmomi import vim, vmodl
from pyVmomi import vim
except ImportError as e:
pass

@ -77,7 +77,7 @@ licenses:
'''
try:
from pyVmomi import vim, vmodl
from pyVmomi import vim
HAS_PYVMOMI = True
except ImportError:
HAS_PYVMOMI = False

@ -81,7 +81,7 @@ dest_file:
import os
try:
from pyVmomi import vim, vmodl
from pyVmomi import vim
except ImportError:
pass

@ -78,11 +78,6 @@ result:
sample: "Datastore cluster 'DSC2' created successfully."
"""
try:
from pyVmomi import vim, vmodl
except ImportError:
pass
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task
from ansible.module_utils._text import to_native

@ -107,7 +107,7 @@ drs_rule_facts:
'''
try:
from pyVmomi import vim, vmodl
from pyVmomi import vim
except ImportError:
pass

@ -523,9 +523,7 @@ import time
HAS_PYVMOMI = False
try:
import pyVmomi
from pyVmomi import vim, vmodl
HAS_PYVMOMI = True
except ImportError:
pass

@ -87,12 +87,6 @@ instance:
sample: None
"""
try:
import pyVmomi
from pyVmomi import vim
except ImportError:
pass
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_text
from ansible.module_utils.vmware import PyVmomi, vmware_argument_spec

@ -152,15 +152,9 @@ instance:
}
"""
try:
import pyVmomi
from pyVmomi import vim
except ImportError:
pass
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_native
from ansible.module_utils.vmware import PyVmomi, vmware_argument_spec, connect_to_api, wait_for_task
from ansible.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task
class PyVmomiHelper(PyVmomi):

@ -221,7 +221,6 @@ instance:
import time
try:
import pyVmomi
from pyVmomi import vim
except ImportError:
pass

@ -110,13 +110,6 @@ from ansible.module_utils._text import to_native
from ansible.module_utils.vmware import PyVmomi, gather_vm_facts, vmware_argument_spec
try:
import pyVmomi
from pyVmomi import vim
except ImportError:
pass
class PyVmomiHelper(PyVmomi):
def __init__(self, module):
super(PyVmomiHelper, self).__init__(module)

@ -103,7 +103,7 @@ facts:
'''
try:
from pyVmomi import vim, vmodl
from pyVmomi import vim
except ImportError:
pass
from ansible.module_utils.basic import AnsibleModule

@ -107,7 +107,7 @@ from ansible.module_utils.basic import AnsibleModule, bytes_to_human
from ansible.module_utils.vmware import PyVmomi, vmware_argument_spec, find_obj
try:
from pyVmomi import vim, vmodl
from pyVmomi import vim
except ImportError:
pass

@ -110,7 +110,7 @@ rule_set_state:
'''
try:
from pyVmomi import vim, vmodl
from pyVmomi import vim
except ImportError:
pass

@ -122,7 +122,7 @@ results:
'''
try:
from pyvmomi import vim, vmodl
from pyvmomi import vim
except ImportError:
pass

@ -94,7 +94,7 @@ RETURN = r'''#
'''
try:
from pyVmomi import vim, vmodl
from pyVmomi import vim
except ImportError:
pass

@ -111,11 +111,6 @@ result:
}
'''
try:
from pyVmomi import vim, vmodl
except ImportError:
pass
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.vmware import PyVmomi, vmware_argument_spec, wait_for_task, TaskError
from ansible.module_utils._text import to_native

@ -66,11 +66,6 @@ local_user_facts:
]
'''
try:
from pyVmomi import vim, vmodl
except ImportError:
pass
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.vmware import PyVmomi, vmware_argument_spec

@ -78,7 +78,7 @@ resource_pool_facts:
'''
try:
from pyVmomi import vim, vmodl
from pyVmomi import vim
except ImportError:
pass

@ -109,11 +109,6 @@ scsi_tgt_facts:
}
"""
try:
from pyVmomi import vim, vmodl
except ImportError:
pass
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.vmware import PyVmomi, vmware_argument_spec

@ -87,7 +87,7 @@ virtual_machines:
'''
try:
from pyVmomi import vim, vmodl
from pyVmomi import vim
except ImportError:
pass

Loading…
Cancel
Save