mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-02 22:39:09 -07:00
gconftool2: refactored to use ModuleHelper + CmdRunner (#5545)
* gconftool2: refactored to use ModuleHelper + CmdRunner * add changelog fragment * removed old code commented out
This commit is contained in:
parent
6a6bbb6577
commit
6c7e9116e1
10 changed files with 186 additions and 142 deletions
|
@ -65,8 +65,8 @@ class GConftoolInfo(ModuleHelper):
|
|||
self.runner = gconftool2_runner(self.module, check_rc=True)
|
||||
|
||||
def __run__(self):
|
||||
with self.runner.context(args_order=["get", "key"]) as ctx:
|
||||
rc, out, err = ctx.run(get=True)
|
||||
with self.runner.context(args_order=["state", "key"]) as ctx:
|
||||
rc, out, err = ctx.run(state="get")
|
||||
self.vars.value = None if err and not out else out.rstrip()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue