mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-09 14:50:02 -07:00
* Improved run_command signature and behaviour
- extra_params has been removed from the signature
- params now can be either str or dict (containing the param value)
* Reverted the removal of the method parameter, and added changelog fragment
* Update changelogs/fragments/1867-modhelper-cmdmixin-dict-params.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update plugins/module_utils/module_helper.py
Co-authored-by: Felix Fontein <felix@fontein.de>
* adjustement per PR
* Update plugins/module_utils/module_helper.py
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 585dd0b6ed
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
b76994ee6e
commit
8ac8fa0aa9
3 changed files with 27 additions and 18 deletions
|
@ -238,7 +238,7 @@ class XFConfProperty(CmdMixin, StateMixin, ModuleHelper):
|
|||
|
||||
def state_absent(self):
|
||||
self.vars.value = None
|
||||
self.run_command(params=('channel', 'property', 'reset'), extra_params={"reset": True})
|
||||
self.run_command(params=('channel', 'property', {'reset': True}))
|
||||
self.update_xfconf_output(previous_value=self.vars.previous_value,
|
||||
value=None)
|
||||
|
||||
|
@ -267,17 +267,13 @@ class XFConfProperty(CmdMixin, StateMixin, ModuleHelper):
|
|||
isinstance(self.vars.previous_value, list) or \
|
||||
values_len > 1
|
||||
|
||||
params = ['channel', 'property', 'create']
|
||||
params = ['channel', 'property', {'create': True}]
|
||||
if self.vars.is_array:
|
||||
params.append('is_array')
|
||||
params.append('values_and_types')
|
||||
|
||||
extra_params = dict(values_and_types=(self.vars.value, value_type))
|
||||
extra_params['create'] = True
|
||||
extra_params['is_array'] = self.vars.is_array
|
||||
params.append({'is_array': True})
|
||||
params.append({'values_and_types': (self.vars.value, value_type)})
|
||||
|
||||
if not self.module.check_mode:
|
||||
self.run_command(params=params, extra_params=extra_params)
|
||||
self.run_command(params=params)
|
||||
|
||||
if not self.vars.is_array:
|
||||
self.vars.value = self.vars.value[0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue