Redo waiting until Project updates are complete

This commit is contained in:
Jeff Bradberry 2020-04-23 15:32:14 -04:00
parent 86afa5cf42
commit a531b85b31

View File

@ -195,9 +195,14 @@ class ApiV2(base.Base):
# We should only impose a default password if the resource doesn't exist.
post_data.setdefault('password', 'abc123')
_page = endpoint.post(post_data)
if asset['natural_key']['type'] == 'project':
# When creating a project, we need to wait for its
# first project update to finish so that associated
# JTs have valid options for playbook names
_page.wait_until_completed()
else:
_page = _page.put(post_data)
except exc.Common as e:
except (exc.Common, AssertionError) as e:
log.error("Object import failed: %s.", e)
log.debug("post_data: %r", post_data)
continue