mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 12:33:59 -07:00
Fix undefined variables, basestring usage, and some associated python3 issues
This commit is contained in:
parent
9f7b0dfc30
commit
225fa5d092
84 changed files with 652 additions and 963 deletions
|
@ -38,9 +38,9 @@ import os
|
|||
import ssl
|
||||
import sys
|
||||
import time
|
||||
import ConfigParser
|
||||
|
||||
from six import text_type, string_types
|
||||
from six import integer_types, text_type, string_types
|
||||
from six.moves import configparser
|
||||
|
||||
# Disable logging message trigged by pSphere/suds.
|
||||
try:
|
||||
|
@ -64,7 +64,7 @@ from suds.sudsobject import Object as SudsObject
|
|||
class VMwareInventory(object):
|
||||
|
||||
def __init__(self, guests_only=None):
|
||||
self.config = ConfigParser.SafeConfigParser()
|
||||
self.config = configparser.SafeConfigParser()
|
||||
if os.environ.get('VMWARE_INI', ''):
|
||||
config_files = [os.environ['VMWARE_INI']]
|
||||
else:
|
||||
|
@ -210,7 +210,7 @@ class VMwareInventory(object):
|
|||
if obj_info != ():
|
||||
l.append(obj_info)
|
||||
return l
|
||||
elif isinstance(obj, (type(None), bool, int, long, float, string_types)):
|
||||
elif isinstance(obj, (type(None), bool, float) + string_types + integer_types):
|
||||
return obj
|
||||
else:
|
||||
return ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue