mirror of
https://github.com/ansible/awx.git
synced 2026-03-10 05:59:28 -02:30
Log an error and continue when a related object is not found
This commit is contained in:
@@ -286,7 +286,9 @@ class ApiV2(base.Base):
|
|||||||
def _assign_related_assets(self, assets):
|
def _assign_related_assets(self, assets):
|
||||||
for asset in assets:
|
for asset in assets:
|
||||||
_page = self._get_by_natural_key(asset['natural_key'])
|
_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():
|
for name, S in asset.get('related', {}).items():
|
||||||
if not S:
|
if not S:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user