Skip to content

Commit

Permalink
Resolved issue with NoneType.
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
y0rune committed Jan 8, 2023
1 parent 6941512 commit 799c2d4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/modules/meraki_mx_content_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 799c2d4

Please sign in to comment.