Remove JSONDecodeError exception, fix tower_host variable issue

This commit is contained in:
beeankha
2020-02-03 10:47:04 -05:00
parent f89061da41
commit 320276f8ca
2 changed files with 7 additions and 6 deletions

View File

@@ -79,7 +79,6 @@ EXAMPLES = '''
from ..module_utils.tower_api import TowerModule
from json import loads
from json.decoder import JSONDecodeError
import re
@@ -110,7 +109,8 @@ def main():
new_value = value
try:
new_value = loads(value)
except JSONDecodeError:
except ValueError:
# JSONDecodeError only available on Python 3.5+
# Attempt to deal with old tower_cli array types
if ',' in value:
new_value = re.split(r",\s+", new_value)