mirror of
https://github.com/ansible/awx.git
synced 2026-04-06 18:49:21 -02:30
Merge pull request #8398 from john-westcott-iv/fix_stack_trace
Fixing stack trace from an error not having a detail Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -393,7 +393,7 @@ class TowerAPIModule(TowerModule):
|
|||||||
if response['status_code'] == 204:
|
if response['status_code'] == 204:
|
||||||
self.json_output['changed'] = True
|
self.json_output['changed'] = True
|
||||||
else:
|
else:
|
||||||
self.fail_json(msg="Failed to disassociate item {0}".format(response['json']['detail']))
|
self.fail_json(msg="Failed to disassociate item {0}".format(response['json'].get('detail', response['json'])))
|
||||||
|
|
||||||
# Associate anything that is in new_association_list but not in `association`
|
# Associate anything that is in new_association_list but not in `association`
|
||||||
for an_id in list(set(new_association_list) - set(existing_associated_ids)):
|
for an_id in list(set(new_association_list) - set(existing_associated_ids)):
|
||||||
@@ -401,7 +401,7 @@ class TowerAPIModule(TowerModule):
|
|||||||
if response['status_code'] == 204:
|
if response['status_code'] == 204:
|
||||||
self.json_output['changed'] = True
|
self.json_output['changed'] = True
|
||||||
else:
|
else:
|
||||||
self.fail_json(msg="Failed to associate item {0}".format(response['json']['detail']))
|
self.fail_json(msg="Failed to associate item {0}".format(response['json'].get('detail', response['json'])))
|
||||||
|
|
||||||
def create_if_needed(self, existing_item, new_item, endpoint, on_create=None, item_type='unknown', associations=None):
|
def create_if_needed(self, existing_item, new_item, endpoint, on_create=None, item_type='unknown', associations=None):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user