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

Zedr wfjt inventories #8353

Merged
merged 2 commits into from
Oct 12, 2020
Merged

Zedr wfjt inventories #8353

merged 2 commits into from
Oct 12, 2020

Conversation

jbradberry
Copy link
Contributor

SUMMARY

The current version of AWX fails to include the url to a non-null Inventory foreign key in the API results for a Workflow Job Template. This PR finishes off work from @zedr to both add that link the the API output, but also attempt a reasonable fallback when using the awx-cli export function against a version of AWX that does not have this fix.

related #7798

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • API
AWX VERSION
awx: 15.0.0

…7798

This changeset introduces two changes:

 1. Update the API representation of Workflow Job Templates to use the
 natural key of the Inventory type instead of its id;
 2. Override the related property of the CLI's WorkflowJobTemplate page
 type to patch the related references during the export process,
 allowing the resource to be serialised using the natural key of the
 Inventory type instead of the id.

Change n.2 is a workaround that is used when exporting resources from
AWX/Tower instances that don't have change n.1. It can be removed in the
future.
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

awx/api/serializers.py Outdated Show resolved Hide resolved
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@ryanpetrello
Copy link
Contributor

@zedr you interested in giving this PR a whirl?

@zedr
Copy link

zedr commented Oct 12, 2020

Good for me!

@squidboylan
Copy link
Contributor

works for me, confirmed that the related field in the api view of a wfjt contains an inventory field

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 119c907 into ansible:devel Oct 12, 2020
@jbradberry jbradberry deleted the zedr-wfjt-inventories branch October 27, 2020 16:20
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.

8 participants