-
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
cmd_runner: add __call__ method to invoke context #4791
cmd_runner: add __call__ method to invoke context #4791
Conversation
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.
Maybe add some actual code changes that use context()
to this PR. (Also don't forget the changelog fragment :) )
@felixfontein do you mean that uses |
And I have unit tests for both usages. |
I mean changing some of the existing code that uses |
That will prove that Python works as expected. :-P Anyways, done. |
Co-authored-by: Felix Fontein <felix@fontein.de>
Backport to stable-5: 💚 backport PR created✅ Backport PR branch: Backported as #4844 🤖 @patchback |
@russoz thanks for this improvement! |
* cmd_runner: add __call__ method to invoke context * change xfconf to use the callable form * add changelog fragment * Update changelogs/fragments/4791-cmd-runner-callable.yaml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 739ca73)
* cmd_runner: add __call__ method to invoke context * change xfconf to use the callable form * add changelog fragment * Update changelogs/fragments/4791-cmd-runner-callable.yaml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 739ca73) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
SUMMARY
Method
context()
renamed to__call__()
, but retaining an alias from the old name to the new one, for compatibility.That change will allow a more concise idiom when running the commands.
ISSUE TYPE
COMPONENT NAME
plugins/module_utils/cmd_runner.py