-
Notifications
You must be signed in to change notification settings - Fork 145
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
Change lookup to query to ensure list #647
Change lookup to query to ensure list #647
Conversation
We're still testing this further. We ran into some issues, but are not yet sure if they're related to this. |
So, I've investigated the issue a bit more. Due to the last return statement ( With the currently added 2 commits, this issue should be resolved. And in my opinion this is ready to be merged once approved :) |
5ead506
to
fe391ef
Compare
fe391ef
to
b01ea27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ivarmu this looks good, looks like we need a changelog though as this is a breaking change, as well as the present/compare list bugfix,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog needed,
* added singulars to be treated as well * new attributes for roles * new attributes for roles * added changelog fragment * fix on map_item function * removed extra empty line * fixes on object_diff inputs * removed debug information. added ORGANIZATIONLESS to credentials and users without an organization * fix lintering issues * fix lintering issues * fix lintering issues * tests fixes. multiple list from #647 fixed. Test ping URL fixed
* added singulars to be treated as well * new attributes for roles * new attributes for roles * added changelog fragment * fix on map_item function * removed extra empty line * fixes on object_diff inputs * removed debug information. added ORGANIZATIONLESS to credentials and users without an organization * fix lintering issues * fix lintering issues * fix lintering issues * tests fixes. multiple list from redhat-cop/infra.aap_configuration#647 fixed. Test ping URL fixed
* added singulars to be treated as well * new attributes for roles * new attributes for roles * added changelog fragment * fix on map_item function * removed extra empty line * fixes on object_diff inputs * removed debug information. added ORGANIZATIONLESS to credentials and users without an organization * fix lintering issues * fix lintering issues * fix lintering issues * tests fixes. multiple list from redhat-cop/infra.aap_configuration#647 fixed. Test ping URL fixed
* Change lookup to query to ensure list * Prevent the diff plugin from returning a nested list * Correctly make use of the present_list * Add changelog fragment --------- Co-authored-by: Marges, RSY (Rick) <[email protected]> Co-authored-by: Ivan Aragonés Muniesa <[email protected]>
* Change lookup to query to ensure list * Prevent the diff plugin from returning a nested list * Correctly make use of the present_list * Add changelog fragment --------- Co-authored-by: Marges, RSY (Rick) <[email protected]> Co-authored-by: Ivan Aragonés Muniesa <[email protected]>
* added singulars to be treated as well * new attributes for roles * new attributes for roles * added changelog fragment * fix on map_item function * removed extra empty line * fixes on object_diff inputs * removed debug information. added ORGANIZATIONLESS to credentials and users without an organization * fix lintering issues * fix lintering issues * fix lintering issues * tests fixes. multiple list from redhat-cop#647 fixed. Test ping URL fixed
What does this PR do?
When first configuring an organization with only 1 inventory defined, the configuration fails with the message:
argument 'controller_inventories' is of type <class 'dict'> and we were unable to convert to list
The diff_role tasks use the
lookup
plugin to calculate the differences, which doesn't necessarily create a list when it recieves one item. This change will move fromlookup
toquery
, which will always return a list (see relevant link for more info)How should this be tested?
with_present: true
Other Relevant info, PRs, etc
https://docs.ansible.com/ansible/latest/plugins/lookup.html#forcing-lookups-to-return-lists-query-and-wantlist-true