mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -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
|
@ -17,8 +17,6 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
from ansible.module_utils.six import iteritems
|
||||
import atexit
|
||||
import os
|
||||
import ssl
|
||||
|
@ -33,6 +31,9 @@ try:
|
|||
except ImportError:
|
||||
HAS_PYVMOMI = False
|
||||
|
||||
from ansible.module_utils.urls import fetch_url
|
||||
from ansible.module_utils.six import integer_types, iteritems, string_types
|
||||
|
||||
|
||||
class TaskError(Exception):
|
||||
pass
|
||||
|
@ -595,17 +596,7 @@ def serialize_spec(clonespec):
|
|||
data[x] = []
|
||||
for xe in xo:
|
||||
data[x].append(serialize_spec(xe))
|
||||
elif issubclass(xt, str):
|
||||
data[x] = xo
|
||||
elif issubclass(xt, unicode):
|
||||
data[x] = xo
|
||||
elif issubclass(xt, int):
|
||||
data[x] = xo
|
||||
elif issubclass(xt, float):
|
||||
data[x] = xo
|
||||
elif issubclass(xt, long):
|
||||
data[x] = xo
|
||||
elif issubclass(xt, bool):
|
||||
elif issubclass(xt, string_types + integer_types + (float, bool)):
|
||||
data[x] = xo
|
||||
elif issubclass(xt, dict):
|
||||
data[x] = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue