Merge pull request #13132 from jbradberry/import-project-schedules

Expand the dependencies of the Schedule page type
This commit is contained in:
Jeff Bradberry
2022-10-31 16:29:04 -04:00
committed by GitHub
2 changed files with 10 additions and 3 deletions

View File

@@ -275,7 +275,13 @@ class ApiV2(base.Base):
# When creating a project, we need to wait for its # When creating a project, we need to wait for its
# first project update to finish so that associated # first project update to finish so that associated
# JTs have valid options for playbook names # JTs have valid options for playbook names
_page.wait_until_completed() try:
_page.wait_until_completed(timeout=300)
except AssertionError:
# If the project update times out, try to
# carry on in the hopes that it will
# finish before it is needed.
pass
else: else:
# If we are an existing project and our scm_tpye is not changing don't try and import the local_path setting # If we are an existing project and our scm_tpye is not changing don't try and import the local_path setting
if asset['natural_key']['type'] == 'project' and 'local_path' in post_data and _page['scm_type'] == post_data['scm_type']: if asset['natural_key']['type'] == 'project' and 'local_path' in post_data and _page['scm_type'] == post_data['scm_type']:

View File

@@ -1,6 +1,7 @@
from contextlib import suppress from contextlib import suppress
from awxkit.api.pages import SystemJobTemplate from awxkit.api.pages import JobTemplate, SystemJobTemplate, Project, InventorySource
from awxkit.api.pages.workflow_job_templates import WorkflowJobTemplate
from awxkit.api.mixins import HasCreate from awxkit.api.mixins import HasCreate
from awxkit.api.resources import resources from awxkit.api.resources import resources
from awxkit.config import config from awxkit.config import config
@@ -11,7 +12,7 @@ from . import base
class Schedule(HasCreate, base.Base): class Schedule(HasCreate, base.Base):
dependencies = [SystemJobTemplate] dependencies = [JobTemplate, SystemJobTemplate, Project, InventorySource, WorkflowJobTemplate]
NATURAL_KEY = ('unified_job_template', 'name') NATURAL_KEY = ('unified_job_template', 'name')
def silent_delete(self): def silent_delete(self):