From 0fda9d2c56ab4d5c328676ff70744f963b6de3b8 Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Thu, 11 Jun 2020 11:17:52 -0400 Subject: [PATCH] Continue after failures to grant roles --- awxkit/awxkit/api/pages/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awxkit/awxkit/api/pages/api.py b/awxkit/awxkit/api/pages/api.py index fe57fe33e8..066153bfd3 100644 --- a/awxkit/awxkit/api/pages/api.py +++ b/awxkit/awxkit/api/pages/api.py @@ -247,6 +247,9 @@ class ApiV2(base.Base): endpoint.post({'id': role_page['id']}) except exc.NoContent: # desired exception on successful (dis)association pass + except exc.Common as e: + log.error("Role assignment failed: %s.", e) + log.debug("post_data: %r", {'id': role_page['id']}) def _assign_membership(self): for _page, roles in self._roles: @@ -288,7 +291,6 @@ class ApiV2(base.Base): except exc.Common as e: log.error("Object association failed: %s.", e) log.debug("post_data: %r", post_data) - raise else: # It is a create set self._cache.get_page(endpoint) self._import_list(endpoint, related_set)