mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 13:11:19 -03:30
Handle json decoder errors from tower inventory source
This commit is contained in:
parent
96fbc9ea27
commit
89a05e9bbc
@ -108,6 +108,8 @@ def read_tower_inventory(tower_host, tower_user, tower_pass, inventory, license_
|
||||
reason = json_reason.get('detail', 'Retrieving Tower Inventory Failed')
|
||||
except requests.ConnectionError, e:
|
||||
reason = "Connection to remote host failed: {}".format(e)
|
||||
except json.JSONDecodeError, e:
|
||||
reason = "Failed to parse json from host: {}".format(e)
|
||||
print(reason)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user