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

[PR #8855/41d87f5c backport][stable-9] gio_mime: adjust module for old vardict deprecation (#8863)

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

* gio_mime: adjust module for old vardict deprecation

* add changelog frag

(cherry picked from commit 41d87f5c9d)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2024-09-13 22:58:33 +02:00 committed by GitHub
parent bd8b7e3737
commit 38a16b421d
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