From 799c2d462af5cbfd92ff93df3b47346a329ce021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Sun, 8 Jan 2023 14:05:16 +0100 Subject: [PATCH] Resolved issue with NoneType. When the code has the only the `generate_diff`. That function does not handle the NoneType for the agrs. So I think it will be better to handle it via is statement `if recursive_diff is None`. --- plugins/modules/meraki_mx_content_filtering.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/modules/meraki_mx_content_filtering.py b/plugins/modules/meraki_mx_content_filtering.py index ede2806d..a8de455a 100644 --- a/plugins/modules/meraki_mx_content_filtering.py +++ b/plugins/modules/meraki_mx_content_filtering.py @@ -155,7 +155,7 @@ from ansible.module_utils.basic import AnsibleModule, json -from ansible_collections.cisco.meraki.plugins.module_utils.network.meraki.meraki import MerakiModule, meraki_argument_spec +from ansible_collections.cisco.meraki.plugins.module_utils.network.meraki.meraki import MerakiModule, meraki_argument_spec, recursive_diff from copy import deepcopy @@ -279,8 +279,12 @@ def main(): meraki.exit_json(**meraki.result) response = meraki.request(path, method='PUT', payload=json.dumps(payload)) meraki.result['data'] = response - meraki.result['changed'] = True - meraki.generate_diff(current, response) + if recursive_diff(current, response) is None: + meraki.result['changed'] = False + meraki.result['data'] = f"{recursive_diff(current, response)}" + else: + meraki.result['changed'] = True + meraki.generate_diff(current, response) else: meraki.result['data'] = current if module.check_mode: