-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
opkg: refactor module to use StateModuleHelper and CmdRunner #5718
opkg: refactor module to use StateModuleHelper and CmdRunner #5718
Conversation
CC @joergho who contributed to this module recently. |
This conflicts with #5688, which is going to be merged before this. Also note that this module has no tests, so this needs to be verified with manual testing whether it works. |
I am happy to adjust this one after the other PR gets merged. And I could get unit tests done, in the meantime. Though they will not support the "old way" of calling run_command with a single string for cmd line. |
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.
With the changes included, the opkg module behaves as before (I ran some tests).
However, in the old implementation there was the output installed/removed %d package(s)
which is now missing. Assigning self.vars.msg
is not possible. Is there another way to do this? Alternatively, I set the install_c
and remove_c
variables as output, so the the information how many packages got installed / removed is still available as output.
@joergho thanks for the thorough check (and catching the typo). We can set the |
I merged #5688, this one now has conflicts. |
6351982
to
97fce37
Compare
I will still create unit tests for this, kinda cookiecutting from previous tests using |
Co-authored-by: joergho <[email protected]>
Co-authored-by: joergho <[email protected]>
Co-authored-by: joergho <[email protected]>
Co-authored-by: joergho <[email protected]>
Co-authored-by: joergho <[email protected]>
Co-authored-by: joergho <[email protected]>
Rebasing the PR |
If you update to the latest version of c.g. from the main branch, the result will always be in |
@felixfontein I think everybody is happy with this one now |
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #5824 🤖 @patchback |
* opkg: refactor module to use StateModuleHelper and CmdRunner * add changelog fragment * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * generate message outcome as before * aggregated changes from 5688 * fix package query * add unit tests * fix sanity error * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * add test for specifying version * refactor parameter name Co-authored-by: joergho <[email protected]> (cherry picked from commit 682bb4b)
…tateModuleHelper and CmdRunner (#5824) opkg: refactor module to use StateModuleHelper and CmdRunner (#5718) * opkg: refactor module to use StateModuleHelper and CmdRunner * add changelog fragment * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * generate message outcome as before * aggregated changes from 5688 * fix package query * add unit tests * fix sanity error * Update plugins/modules/opkg.py Co-authored-by: joergho <[email protected]> * add test for specifying version * refactor parameter name Co-authored-by: joergho <[email protected]> (cherry picked from commit 682bb4b) Co-authored-by: Alexei Znamensky <[email protected]>
SUMMARY
Refactor the module to use StateModuleHelper and CmdRunner. As a side effect, running opkg is now passing parameters in a safer way.
ISSUE TYPE
COMPONENT NAME
plugins/modules/opkg.py