mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 04:10:44 -03:30
Merge pull request #5815 from ryanpetrello/fix-cli-settings-py2
fix a py2/py3 compat bug in the settings CLI Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
commit
ad53f4f5f6
@ -1,7 +1,7 @@
|
||||
import functools
|
||||
import json
|
||||
|
||||
from six import with_metaclass
|
||||
from six import with_metaclass, PY3
|
||||
|
||||
from .stdout import monitor, monitor_workflow
|
||||
from .utils import CustomRegistryMeta, color_enabled
|
||||
@ -547,8 +547,11 @@ class SettingsModify(CustomAction):
|
||||
return resp.from_json({'key': key, 'value': resp[key]})
|
||||
|
||||
def is_json(self, data):
|
||||
err = ValueError
|
||||
if PY3:
|
||||
err = json.decoder.JSONDecodeError
|
||||
try:
|
||||
json.loads(data)
|
||||
except json.decoder.JSONDecodeError:
|
||||
except err:
|
||||
return False
|
||||
return True
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user