CiscoDevNet/ansible-meraki

meraki_mx_content_filtering - problem with restarting policy and idempotency

y0rune opened this issue · 2 comments

In the #406 I found out the issue with restarting policy and when the I would like to set the same categories I got error too.

When the code (https://github.com/CiscoDevNet/ansible-meraki/pull/408/files#diff-9349c9a862e686b681535d62c49b8473a8e1712f6c718b561999cb0e5588a0c8R55-R73) is unhide, I got the error:

TASK [meraki_mx_content_filtering : Set blocked URL categories with idempotency] ***
task path: /Users/yorune/git/ansible_collections/cisco/meraki/tests/output/.tmp/integration/meraki_mx_content_filtering-74q35ouv-ÅÑŚÌβŁÈ/tests/integration/targets/meraki_mx_content_filtering/tasks/main.yml:55
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: 'NoneType' object is not subscriptable
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/Users/yorune/.ansible/tmp/ansible-tmp-1673052940.428527-4223-231441927345808/AnsiballZ_meraki_mx_content_filtering.py\", line 121, in <module>\n    _ansiballz_main()\n  File \"/Users/yorune/.ansible/tmp/ansible-tmp-1673052940.428527-4223-231441927345808/AnsiballZ_meraki_mx_content_filtering.py\", line 113, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/Users/yorune/.ansible/tmp/ansible-tmp-1673052940.428527-4223-231441927345808/AnsiballZ_meraki_mx_content_filtering.py\", line 61, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.cisco.meraki.plugins.modules.meraki_mx_content_filtering', init_globals=dict(_module_fqn='ansible_collections.cisco.meraki.plugins.modules.meraki_mx_content_filtering', _modlib_path=modlib_path),\n  File \"<frozen runpy>\", line 226, in run_module\n  File \"<frozen runpy>\", line 98, in _run_module_code\n  File \"<frozen runpy>\", line 88, in _run_code\n  File \"/tmp/ansible_cisco.meraki.meraki_mx_content_filtering_payload_tjxq67km/ansible_cisco.meraki.meraki_mx_content_filtering_payload.zip/ansible_collections/cisco/meraki/plugins/modules/meraki_mx_content_filtering.py\", line 302, in <module>\n  File \"/tmp/ansible_cisco.meraki.meraki_mx_content_filtering_payload_tjxq67km/ansible_cisco.meraki.meraki_mx_content_filtering_payload.zip/ansible_collections/cisco/meraki/plugins/modules/meraki_mx_content_filtering.py\", line 287, in main\n  File \"/tmp/ansible_cisco.meraki.meraki_mx_content_filtering_payload_tjxq67km/ansible_cisco.meraki.meraki_mx_content_filtering_payload.zip/ansible_collections/cisco/meraki/plugins/module_utils/network/meraki/meraki.py\", line 205, in generate_diff\nTypeError: 'NoneType' object is not subscriptable\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

In the #408. I resolved the issue with the resetting the policy. I changed the if statements when the params can be None (https://github.com/CiscoDevNet/ansible-meraki/pull/408/files#diff-58896b6b67b925b4b3dd0f4a6f8d7c077a0cae3dea627f17622ef358dd3487ebL236-L240). But i cannot resolve the below issue with it. Can you try to see it @kbreit and @joshuajcoronado ?
Thank you!