mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
* cmd_runner: add __call__ method to invoke context
* change xfconf to use the callable form
* add changelog fragment
* Update changelogs/fragments/4791-cmd-runner-callable.yaml
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 739ca737f1
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
82a764446b
commit
eafcdfbceb
4 changed files with 73 additions and 5 deletions
|
@ -205,11 +205,11 @@ class XFConfProperty(StateModuleHelper):
|
|||
return result
|
||||
|
||||
def _get(self):
|
||||
with self.runner.context('channel property', output_process=self.process_command_output) as ctx:
|
||||
with self.runner('channel property', output_process=self.process_command_output) as ctx:
|
||||
return ctx.run()
|
||||
|
||||
def state_absent(self):
|
||||
with self.runner.context('channel property reset', check_mode_skip=True) as ctx:
|
||||
with self.runner('channel property reset', check_mode_skip=True) as ctx:
|
||||
ctx.run(reset=True)
|
||||
self.vars.value = None
|
||||
|
||||
|
@ -235,7 +235,7 @@ class XFConfProperty(StateModuleHelper):
|
|||
isinstance(self.vars.previous_value, list) or \
|
||||
values_len > 1
|
||||
|
||||
with self.runner.context('channel property create force_array values_and_types', check_mode_skip=True) as ctx:
|
||||
with self.runner('channel property create force_array values_and_types', check_mode_skip=True) as ctx:
|
||||
ctx.run(create=True, force_array=self.vars.is_array, values_and_types=(self.vars.value, value_type))
|
||||
|
||||
if not self.vars.is_array:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue