Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] adding Schedule to dependent_export to allow previous behavior on job template export #13539

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

gamuniz
Copy link
Contributor

@gamuniz gamuniz commented Feb 8, 2023

SUMMARY

Previously awxkit would allow individual job template, inventory_source, workflow template schedules to be exported as a related field to the resource json returned on export. This change reintroduces that behavior.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • CLI
AWX VERSION
make VERSION
awx: 21.11.1.dev65+g0d7bbb4389
ADDITIONAL INFORMATION

@gamuniz
Copy link
Contributor Author

gamuniz commented Feb 8, 2023

Steps to test:

checkout pr

pip install -e awxkit

create a new schedule attach it to demo job template:

awx --conf.host=http://localhost:8013 -k --conf.username admin --conf.password password schedule create --name test-export --unified_job_template 7 --rrule "DTSTART;TZID=America/New_York:20230208T163000 RRULE:INTERVAL=1;FREQ=DAILY"

test export:

awx --conf.host=http://localhost:8013 -k --conf.username admin --conf.password password export --job_templates 7

expected result:

"schedules": [
                         {
                              "rrule": "DTSTART;TZID=America/New_York:20230208T163000 RRULE:INTERVAL=1;FREQ=DAILY",
                              "name": "test_export",
                              "description": "",
                              "extra_data": {},
                              "scm_branch": null,
                              "job_type": null,
                              "job_tags": null,
                              "skip_tags": null,
                              "limit": null,
                              "diff_mode": null,
                              "verbosity": null,
                              "execution_environment": null,
                              "forks": null,
                              "job_slice_count": null,
                              "timeout": null,
                              "enabled": true,
                              "inventory": {
                                   "organization": {
                                        "name": "Default",
                                        "type": "organization"
                                   },
                                   "name": "Demo Inventory",
                                   "type": "inventory"
                              },
                              "unified_job_template": {
                                   "organization": {
                                        "name": "Default",
                                        "type": "organization"
                                   },
                                   "name": "Demo Job Template",
                                   "type": "job_template"
                              },
                              "related": {
                                   "credentials": []
                              },
                              "natural_key": {
                                   "unified_job_template": {
                                        "organization": {
                                             "name": "Default",
                                             "type": "organization"
                                        },
                                        "name": "Demo Job Template",
                                        "type": "job_template"
                                   },
                                   "name": "test_export",
                                   "type": "schedule"
                              }
                         }
                    ]

@TheRealHaoLiu TheRealHaoLiu changed the title [AAP-8682] adding Schedule to dependent_export to allow previous behavior on job template export [fix] adding Schedule to dependent_export to allow previous behavior on job template export Feb 8, 2023
@TheRealHaoLiu TheRealHaoLiu merged commit 46ea031 into ansible:devel Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants