Skip constructed_inventory endpoint in awxkit import

This commit is contained in:
John Westcott IV 2023-05-10 14:24:27 -04:00
parent 85e7189ee3
commit ba7f97f84b

View File

@ -404,6 +404,11 @@ class ApiV2(base.Base):
for resource in self._dependent_resources():
endpoint = getattr(self, resource)
# The /api/v2/constructed_inventories endpoint is for the UI but will register as an Inventory endpoint causing import issues, so skip it
if endpoint == '/api/v2/constructed_inventories/':
log.debug("Ignoring /api/v2/constructed_inventories/ endpoint.")
continue
# Load up existing objects, so that we can try to update or link to them
self._cache.get_page(endpoint)
imported = self._import_list(endpoint, data.get(resource) or [])