From 41d87f5c9dbaeeffab13df8a74a8c1cdcc5fec6a Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Sat, 14 Sep 2024 08:40:34 +1200 Subject: [PATCH] gio_mime: adjust module for old vardict deprecation (#8855) * gio_mime: adjust module for old vardict deprecation * add changelog frag --- changelogs/fragments/8855-gio_mime_vardict.yml | 2 ++ plugins/modules/gio_mime.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/8855-gio_mime_vardict.yml diff --git a/changelogs/fragments/8855-gio_mime_vardict.yml b/changelogs/fragments/8855-gio_mime_vardict.yml new file mode 100644 index 0000000000..54efa08579 --- /dev/null +++ b/changelogs/fragments/8855-gio_mime_vardict.yml @@ -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). diff --git a/plugins/modules/gio_mime.py b/plugins/modules/gio_mime.py index 82c583c76f..bb1ef6ebe3 100644 --- a/plugins/modules/gio_mime.py +++ b/plugins/modules/gio_mime.py @@ -84,7 +84,7 @@ class GioMime(ModuleHelper): ), supports_check_mode=True, ) - mute_vardict_deprecation = True + use_old_vardict = False def __init_module__(self): self.runner = gio_mime_runner(self.module, check_rc=True) @@ -92,7 +92,7 @@ class GioMime(ModuleHelper): def __run__(self): 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: rc, out, err = ctx.run() self.vars.stdout = out