Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_update_required() should handle different types to avoid traceback #6

Closed
kbreit opened this issue Dec 23, 2019 · 0 comments · Fixed by #7
Closed

is_update_required() should handle different types to avoid traceback #6

kbreit opened this issue Dec 23, 2019 · 0 comments · Fixed by #7
Assignees

Comments

@kbreit
Copy link
Collaborator

kbreit commented Dec 23, 2019

is_update_required() no longer does a type check which means there can be a segmentation fault if .items() is used on objects other than a dict. Exception handling should fix this problem.

TASK [meraki_content_filtering : Set blocked URL category using net_id] ********
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'str' object has no attribute 'items'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1577141540.0925586-253906176221639/AnsiballZ_meraki_content_filtering.py\", line 116, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1577141540.0925586-253906176221639/AnsiballZ_meraki_content_filtering.py\", line 108, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1577141540.0925586-253906176221639/AnsiballZ_meraki_content_filtering.py\", line 54, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.cisco.meraki.plugins.modules.meraki_content_filtering', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_meraki_content_filtering_payload_x_7y2c19/ansible_meraki_content_filtering_payload.zip/ansible_collections/cisco/meraki/plugins/modules/meraki_content_filtering.py\", line 248, in <module>\n  File \"/tmp/ansible_meraki_content_filtering_payload_x_7y2c19/ansible_meraki_content_filtering_payload.zip/ansible_collections/cisco/meraki/plugins/modules/meraki_content_filtering.py\", line 221, in main\n  File \"/tmp/ansible_meraki_content_filtering_payload_x_7y2c19/ansible_meraki_content_filtering_payload.zip/ansible_collections/cisco/meraki/plugins/module_utils/network/meraki/meraki.py\", line 245, in is_update_required\n  File \"/tmp/ansible_meraki_content_filtering_payload_x_7y2c19/ansible_meraki_content_filtering_payload.zip/ansible_collections/cisco/meraki/plugins/module_utils/network/meraki/meraki.py\", line 238, in is_update_required\n  File \"/tmp/ansible_meraki_content_filtering_payload_x_7y2c19/ansible_meraki_content_filtering_payload.zip/ansible_collections/cisco/meraki/plugins/module_utils/network/meraki/meraki.py\", line 242, in is_update_required\nAttributeError: 'str' object has no attribute 'items'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
kbreit added a commit to kbreit/ansible-meraki that referenced this issue Dec 23, 2019
- Add integration test as well
- Pending on issue CiscoDevNet#6
@kbreit kbreit self-assigned this Dec 23, 2019
@kbreit kbreit added this to In progress in v0.1.0 Status Dec 24, 2019
@kbreit kbreit closed this as completed in #7 Dec 25, 2019
v0.1.0 Status automation moved this from In progress to Done Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v0.1.0 Status
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant