Skip to content

Commit

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

* Add changelog fragment for cmd-runner bugfix (ansible-collections#4903)
  • Loading branch information
alvarontwrk authored and Dušan Markovič committed Nov 7, 2022
1 parent 55703c2 commit 4b4a4e5
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 4b4a4e5

Please sign in to comment.