-
Notifications
You must be signed in to change notification settings - Fork 144
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
An inventory source is not ever assigned to an organization #563
An inventory source is not ever assigned to an organization #563
Conversation
I am not sure I like this... |
Have in mind that the |
The ONLY use of organization in the inventory source is to lookup the parent inventory, So if the ORG does not exist, it should not matter, its if the parent inventory exists is the key question. The actual use case if for cases where the user has access to multiple orgs where they have identical inventory names. I am not sure what scenario this is trying to fix, where filetree create, creates an inventory source with no org, which should be fixed in create, or user error where they added it manuallly? |
This is trying to fix the error thrown by the filetree_create when is exporting an inventory_source that is not assigned to any organization. That scenario is currently breaking the execution and it shouldn't, as it is a real and feasible case. |
I'm not sure in what cases it's possible to have an inventory_source without organization. I mean, organization is mandatory for inventories and inventory is mandatory for inventory_sources. Then, inventory_source should always have inventory_source.summary_fields.organization.name. I don't understand why awx/controller module accepts organization for inventory_source https://docs.ansible.com/ansible/latest/collections/awx/awx/inventory_source_module.html#parameter-organization when if you set an organization different than inventory's organization, it will fail. On the other hand, controller_object_diff is trying to compare organization but it could fail because organization is not mandatory for inventory_source: https://github.com/redhat-cop/controller_configuration/blob/devel/plugins/lookup/controller_object_diff.py#L151-L153 |
Until we move to export, the summary fields is the only way to look at this, it should not be possible to have an inventory without an org, so this should always work. |
…op#563) * an inventory source is not ever assigned to an organization * if no organization, no output for organization field
* An inventory source is not ever assigned to an organization (#563) * an inventory source is not ever assigned to an organization * if no organization, no output for organization field * linting * update workflow --------- Co-authored-by: Ivan Aragonés Muniesa <[email protected]>
* An inventory source is not ever assigned to an organization (#563) * an inventory source is not ever assigned to an organization * if no organization, no output for organization field * linting * update workflow * update enforced defaults --------- Co-authored-by: Ivan Aragonés Muniesa <[email protected]>
…op#563) * an inventory source is not ever assigned to an organization * if no organization, no output for organization field
* An inventory source is not ever assigned to an organization (redhat-cop#563) * an inventory source is not ever assigned to an organization * if no organization, no output for organization field * linting * update workflow --------- Co-authored-by: Ivan Aragonés Muniesa <[email protected]>
* An inventory source is not ever assigned to an organization (redhat-cop#563) * an inventory source is not ever assigned to an organization * if no organization, no output for organization field * linting * update workflow --------- Co-authored-by: Ivan Aragonés Muniesa <[email protected]>
* An inventory source is not ever assigned to an organization (redhat-cop#563) * an inventory source is not ever assigned to an organization * if no organization, no output for organization field * linting * update workflow * update enforced defaults --------- Co-authored-by: Ivan Aragonés Muniesa <[email protected]>
What does this PR do?
When exporting an inventory source, if it has not associated organization, the filetree_create role will fail as no organization field is found. This is fixing that error and setting a ToDo organization name instead.
How should this be tested?
Automatic tests.
Is there a relevant Issue open for this?
N/A
Other Relevant info, PRs, etc
N/A