mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-26 14:41:23 -07:00
Migrate basestring to a python3 compatible type (#17199)
This commit is contained in:
parent
a695e18615
commit
a22909c226
28 changed files with 137 additions and 101 deletions
|
@ -22,6 +22,7 @@ from distutils.version import LooseVersion
|
|||
from ansible.module_utils.basic import AnsibleModule, env_fallback, get_exception
|
||||
from ansible.module_utils.shell import Shell, ShellError, HAS_PARAMIKO
|
||||
from ansible.module_utils.netcfg import parse
|
||||
from ansible.module_utils.six import string_types
|
||||
|
||||
try:
|
||||
from jnpr.junos import Device
|
||||
|
@ -70,7 +71,7 @@ def to_list(val):
|
|||
|
||||
|
||||
def xml_to_json(val):
|
||||
if isinstance(val, basestring):
|
||||
if isinstance(val, string_types):
|
||||
return jxmlease.parse(val)
|
||||
else:
|
||||
return jxmlease.parse_etree(val)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue