Skip to content

Commit

Permalink
Fix command variable usage in CmdRunner (#4903) (#4905)
Browse files Browse the repository at this point in the history
* Fix command variable usage

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

(cherry picked from commit 265c052)

Co-authored-by: Álvaro García Jaén <[email protected]>
  • Loading branch information
patchback[bot] and alvarontwrk authored Jun 30, 2022
1 parent 35c4de1 commit 29145b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/4903-cmdrunner-bugfix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- cmd_runner module utils - fix bug caused by using the ``command`` variable instead of ``self.command`` when looking for binary path (https://github.com/ansible-collections/community.general/pull/4903).
2 changes: 1 addition & 1 deletion plugins/module_utils/cmd_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def __init__(self, module, command, arg_formats=None, default_args_order=(),
environ_update = {}
self.environ_update = environ_update

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

for mod_param_name, spec in iteritems(module.argument_spec):
if mod_param_name not in self.arg_formats:
Expand Down

0 comments on commit 29145b1

Please sign in to comment.