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

[PR #4903/265c052c backport][stable-4] Fix command variable usage in CmdRunner #4905

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Jun 30, 2022

This is a backport of PR #4903 as merged into main (265c052).

SUMMARY

It exists a bug in CmdRunner where the wrong "command" variable is being used in order to get the binary path.

Before executing, it is ensured that the command is a list.

self.command = _ensure_list(command)

However, further in the code, command[0] is used instead of self.command[0].

self.command[0] = module.get_bin_path(command[0], opt_dirs=path_prefix, required=True)

Because of this, if command is a string (p.e. xfconf-query), get_bin_path will look for "x" instead of "xfconf-query".

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

plugins/module_utils/cmd_runner.py

ADDITIONAL INFORMATION

Right now, this is affecting the following components:

  • plugins/module_utils/xfconf.py
  • plugins/module_utils/gconftool2.py

* Fix command variable usage

* Add changelog fragment for cmd-runner bugfix (#4903)

(cherry picked from commit 265c052)
@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug module_utils module_utils new_contributor Help guide this first time contributor plugins plugin (any type) labels Jun 30, 2022
@felixfontein felixfontein merged commit 29145b1 into stable-4 Jun 30, 2022
@felixfontein felixfontein deleted the patchback/backports/stable-4/265c052c27f5d3d1b2fc80a771172f32140d0140/pr-4903 branch June 30, 2022 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module_utils module_utils new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants