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

gio_mime: adjust module for old vardict deprecation (#8855)

* gio_mime: adjust module for old vardict deprecation

* add changelog frag
This commit is contained in:
Alexei Znamensky 2024-09-14 08:40:34 +12:00 committed by GitHub
parent 40f1ab31f5
commit 41d87f5c9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- gio_mime - adjust code ahead of the old ``VardDict`` deprecation (https://github.com/ansible-collections/community.general/pull/8855).

View file

@ -84,7 +84,7 @@ class GioMime(ModuleHelper):
), ),
supports_check_mode=True, supports_check_mode=True,
) )
mute_vardict_deprecation = True use_old_vardict = False
def __init_module__(self): def __init_module__(self):
self.runner = gio_mime_runner(self.module, check_rc=True) self.runner = gio_mime_runner(self.module, check_rc=True)
@ -92,7 +92,7 @@ class GioMime(ModuleHelper):
def __run__(self): def __run__(self):
check_mode_return = (0, 'Module executed in check mode', '') check_mode_return = (0, 'Module executed in check mode', '')
if self.vars.has_changed("handler"): if self.vars.has_changed:
with self.runner.context(args_order=["mime_type", "handler"], check_mode_skip=True, check_mode_return=check_mode_return) as ctx: with self.runner.context(args_order=["mime_type", "handler"], check_mode_skip=True, check_mode_return=check_mode_return) as ctx:
rc, out, err = ctx.run() rc, out, err = ctx.run()
self.vars.stdout = out self.vars.stdout = out