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

Redfish modules: rename _facts -> _info #60992

Merged
merged 6 commits into from Aug 26, 2019

Conversation

felixfontein
Copy link
Contributor

@felixfontein felixfontein commented Aug 21, 2019

SUMMARY

Fixes #60523.

ISSUE TYPE
  • Bugfix Pull Request
  • New Module Pull Request
COMPONENT NAME

redfish_facts
idrac_redfish_facts

@ansibot
Copy link
Contributor

ansibot commented Aug 21, 2019

@ansibot

This comment has been minimized.

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. deprecated This issue/PR relates to a deprecated module. docs This issue/PR relates to or includes documentation. has_issue module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_triage Needs a first human triage before being processed. new_module This PR includes a new module. new_plugin This PR includes a new plugin. remote_management Working Group: https://docs.ansible.com/ansible/latest/community/communication.html support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Aug 21, 2019
@ansibot

This comment has been minimized.

@felixfontein
Copy link
Contributor Author

ready_for_review

Copy link
Contributor

@billdodd billdodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that this leaves us with two copies of essentially the same module that must be maintained going forward. Can't this be done in a way that we have, for example, a redfish_info.py module and the redfish_facts.py module just calls the redfish_info.py module? Similar to how the cloudformation_info.py <-> cloudformation_facts.py modules are handled in #60178?

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Aug 22, 2019
@felixfontein
Copy link
Contributor Author

@billdodd the difference to cloudformation_info/facts is that there, the return value's name did not contain facts. Here, the return variable name is called redfish_facts (in both modules). Of course, you can have a _info module for which you have to use result.redfish_facts if you prefer that, I assumed (since there was no reaction to #60523) that there was no preference and chose the nicer return name.

@felixfontein
Copy link
Contributor Author

@billdodd so what do you prefer?
a) deprecate _facts and add info (this PR now);
b) rename module and keep _facts in return value name (even though it is no longer ansible_facts);
c) something else?

There's also the possibility of renaming the module and making the return value name dependent on whether the module is called as _info or _facts. I personally don't think it's a good solution, since the auto-generated documentation is less clear, but if you really want this, we can also do that. This is what the Hetzner cloud team did (see here).

@billdodd
Copy link
Contributor

@felixfontein Thanks for the details and options. I’m away from my computer today, but will review and respond tomorrow.

@billdodd
Copy link
Contributor

@felixfontein:

My original thought was to do this option that you described:

There's also the possibility of renaming the module and making the return value name dependent on whether the module is called as _info or _facts.

But I didn't consider the auto-generated documentation issue you mentioned.

Given that, it seems like the better option would be your option (b):

b) rename module and keep _facts in return value name (even though it is no longer ansible_facts);

I really want to avoid having both redfish_facts and redfish_info modules side-by-side that both need to be maintained (duplicate code). If I understand correctly, your option (b) does avoid that situation. Do I understand correctly?

BTW - I don't really have a preference or issue regarding whether the return value name is "redfish_facts" vs. "redfish_info". So whichever of those you think makes the most sense for Ansible in this situation is fine with me.

@felixfontein
Copy link
Contributor Author

Given that, it seems like the better option would be your option (b):

b) rename module and keep _facts in return value name (even though it is no longer ansible_facts);

I really want to avoid having both redfish_facts and redfish_info modules side-by-side that both need to be maintained (duplicate code). If I understand correctly, your option (b) does avoid that situation. Do I understand correctly?

Yes, that's correct. There is one copy of the module, and it handles both its names slightly differently. (And the _facts name is deprecated and will vanish in 4 versions.)

BTW - I don't really have a preference or issue regarding whether the return value name is "redfish_facts" vs. "redfish_info". So whichever of those you think makes the most sense for Ansible in this situation is fine with me.

I would say anything but redfish_facts :-) But with option b) from above, it has to be that name.

@billdodd
Copy link
Contributor

Yes, that's correct. There is one copy of the module, and it handles both its names slightly differently. (And the _facts name is deprecated and will vanish in 4 versions.)

Sounds good!

I would say anything but redfish_facts :-) But with option b) from above, it has to be that name.

Got it. :-) Thanks again for your help.

@felixfontein
Copy link
Contributor Author

Ok. I'll adjust the PR next week (probably Monday).

@felixfontein
Copy link
Contributor Author

I rebased (to remove conflict) and then added a commit which changes the PR to the rename method. PTAL!

Copy link
Contributor

@samccann samccann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs portion LGTM

Copy link
Contributor

@billdodd billdodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the changes and did a test with the old module name and the new module name. All LGTM.

Thanks @felixfontein

shipit

@felixfontein
Copy link
Contributor Author

Great! Thanks a lot for reviewing and testing, @billdodd!

@felixfontein felixfontein merged commit 47c2ff4 into ansible:devel Aug 26, 2019
@felixfontein felixfontein deleted the info-redfish branch August 26, 2019 18:42
adharshsrivatsr pushed a commit to adharshsrivatsr/ansible that referenced this pull request Sep 3, 2019
* Rename redfish_facts -> redfish_info, idrac_redfish_facts -> idrac_redfish_info

* Update porting guide.

* Add changelog.

* Fix metadata.

* Remove copy artefacts.

* Change from deprecate/new module to rename.
anas-shami pushed a commit to anas-shami/ansible that referenced this pull request Sep 23, 2019
* Rename redfish_facts -> redfish_info, idrac_redfish_facts -> idrac_redfish_info

* Update porting guide.

* Add changelog.

* Fix metadata.

* Remove copy artefacts.

* Change from deprecate/new module to rename.
@ansible ansible locked and limited conversation to collaborators Sep 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. deprecated This issue/PR relates to a deprecated module. docs This issue/PR relates to or includes documentation. has_issue module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_module This PR includes a new module. new_plugin This PR includes a new plugin. remote_management Working Group: https://docs.ansible.com/ansible/latest/community/communication.html support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redfish _facts modules need to be renamed to _info and stop returning ansible_facts
4 participants