1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

xfconf - state absent was not honoring check_mode (#2185) (#2186)

* state absent was not honoring check_mode

* added changelog fragment

(cherry picked from commit 9a5191d1f9)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-04-06 17:26:52 +02:00 committed by GitHub
parent deb1071666
commit 0f1ccc07c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- xfconf - module was not honoring check mode when ``state`` was ``absent`` (https://github.com/ansible-collections/community.general/pull/2185).

View file

@ -237,8 +237,9 @@ class XFConfProperty(CmdMixin, StateMixin, ModuleHelper):
self.update_xfconf_output(value=self.vars.value) self.update_xfconf_output(value=self.vars.value)
def state_absent(self): def state_absent(self):
self.vars.value = None if not self.module.check_mode:
self.run_command(params=('channel', 'property', {'reset': True})) self.run_command(params=('channel', 'property', {'reset': True}))
self.vars.value = None
self.update_xfconf_output(previous_value=self.vars.previous_value, self.update_xfconf_output(previous_value=self.vars.previous_value,
value=None) value=None)