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.
I'm not sure that this function is actually in use anywhere anymore, but
it shouldn't be a top-level import because it represents an optional
dependency.
This changset allows the import of YAML formatted resources. The CLI
user can indicate which format to use with the `-f, --format` option.
The CLI help text has been amended to reflect the new feature.
The AWX CLI `export` subcommand offers the option of formatting the output
as YAML or JSON, so it makes sense that the `import` subcommand reflects
this.
A simple test is also provided. In order to ease the task of testing
commands that import resources by reading the stdin, the CLI has been
extended to allow specifying an alternative file descriptor for stdin,
similarly to stdout and stderr.
This change adds related Labels to the Workflow Job Template document that is
exported by the AWX CLI.
Previously, exporting and then importing Workflow Job Templates would
not retain their related Labels.
This change fixes an erroneus early return in a private method that was
preventing more than one type of related object from being correctly
assigned to the parent object, and therefore imported.
Also, a minor spelling mistake was corrected.
Does not have an organization by default. Let `create_payload` decide if
it should be automatically created or not. This will avoid having more
than one owner when either user or team is passed to `create`.
This will allow the related m2m views to also use this method, with a
bit of effort. Also, remove the use of pk_or_name in favor of a new
method that reduces the number of api calls.
such as due to a lack of permissions. If there is a foreign key to
something where we don't have sufficient read permissions, we now drop
the parent object from the export.