You've already forked community.general
mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-30 18:43:09 +03:00
ModuleHelper - cmd params now taken from self.vars instead of self.module.params (#2517)
* cmd params now taken from self.vars instead of self.module.params * added changelog fragment * Update changelogs/fragments/2517-cmd-params-from-vars.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@ -120,7 +120,7 @@ class CmdMixin(object):
|
||||
cmd_args[0] = self.module.get_bin_path(cmd_args[0], required=True)
|
||||
except ValueError:
|
||||
pass
|
||||
param_list = params if params else self.module.params.keys()
|
||||
param_list = params if params else self.vars.keys()
|
||||
|
||||
for param in param_list:
|
||||
if isinstance(param, dict):
|
||||
@ -131,9 +131,9 @@ class CmdMixin(object):
|
||||
fmt = find_format(_param)
|
||||
value = param[_param]
|
||||
elif isinstance(param, str):
|
||||
if param in self.module.argument_spec:
|
||||
if param in self.vars.keys():
|
||||
fmt = find_format(param)
|
||||
value = self.module.params[param]
|
||||
value = self.vars[param]
|
||||
elif param in extra_params:
|
||||
fmt = find_format(param)
|
||||
value = extra_params[param]
|
||||
|
Reference in New Issue
Block a user