summaryrefslogtreecommitdiffstats
path: root/awxkit
diff options
context:
space:
mode:
authorJeff Bradberry <jeff.bradberry@gmail.com>2020-04-23 17:11:35 +0200
committerJeff Bradberry <jeff.bradberry@gmail.com>2020-06-09 19:54:05 +0200
commit57aff6394c93f6dd8c7b242ca8ec0024f53f2635 (patch)
tree90daf6cba47f5798b160c8f2d4bf8542715ec78b /awxkit
parentReuse _import_list for import of related full objects (diff)
downloadawx-57aff6394c93f6dd8c7b242ca8ec0024f53f2635.tar.xz
awx-57aff6394c93f6dd8c7b242ca8ec0024f53f2635.zip
Log an error and continue when a related object is not found
Diffstat (limited to 'awxkit')
-rw-r--r--awxkit/awxkit/api/pages/api.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/awxkit/awxkit/api/pages/api.py b/awxkit/awxkit/api/pages/api.py
index 72d1fa4bf5..4c70ed144d 100644
--- a/awxkit/awxkit/api/pages/api.py
+++ b/awxkit/awxkit/api/pages/api.py
@@ -286,7 +286,9 @@ class ApiV2(base.Base):
def _assign_related_assets(self, assets):
for asset in assets:
_page = self._get_by_natural_key(asset['natural_key'])
- # FIXME: deal with `_page is None` case
+ if _page is None:
+ log.error("Related object with natural key not found: %r", asset['natural_key'])
+ continue
for name, S in asset.get('related', {}).items():
if not S:
continue