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

Create interface if the interface existing error #114

Closed
tkspuk opened this issue Feb 24, 2020 · 3 comments · Fixed by #117
Closed

Create interface if the interface existing error #114

tkspuk opened this issue Feb 24, 2020 · 3 comments · Fixed by #117
Labels
bug Something isn't working PR Submitted

Comments

@tkspuk
Copy link

tkspuk commented Feb 24, 2020

ISSUE TYPE
  • Bug Report
SUMMARY

netbox 2.7.6
ansible_model: 0.1.7

STEPS TO REPRODUCE

If the interface exists, executing the playbook will report an error.0.1.6 normal, but 0.1.7 error

    - name: "2 - Create LAG with several specified options"
      netbox_device_interface:
        netbox_url: "http://localhost:32768"
        netbox_token: "64d95bd488a66f3b745ed175df8d0ce089af5b0b"
        data:
          device: R1-Device
          name: Eth-Trunk1
          form_factor: Link Aggregation Group (LAG)
          mtu: 1600
          mgmt_only: false
          mode: Tagged
        state: present
EXPECTED RESULTS
ACTUAL RESULTS
TASK [2 - Create LAG with several specified options] ***************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: pynetbox.core.query.RequestError: The requested url: http://localhost:32768/api/dcim/interfaces/3/ could not be found.
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/Users/mtlocus/.ansible/tmp/ansible-tmp-1582528691.2772648-230475811225017/AnsiballZ_netbox_device_interface.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/Users/mtlocus/.ansible/tmp/ansible-tmp-1582528691.2772648-230475811225017/AnsiballZ_netbox_device_interface.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/Users/mtlocus/.ansible/tmp/ansible-tmp-1582528691.2772648-230475811225017/AnsiballZ_netbox_device_interface.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.netbox_community.ansible_modules.plugins.modules.netbox_device_interface', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/var/folders/rv/3qvskvh554n0dc38n7zjczx80000gp/T/ansible_netbox_device_interface_payload_dou7dyb9/ansible_netbox_device_interface_payload.zip/ansible_collections/netbox_community/ansible_modules/plugins/modules/netbox_device_interface.py\", line 261, in <module>\n  File \"/var/folders/rv/3qvskvh554n0dc38n7zjczx80000gp/T/ansible_netbox_device_interface_payload_dou7dyb9/ansible_netbox_device_interface_payload.zip/ansible_collections/netbox_community/ansible_modules/plugins/modules/netbox_device_interface.py\", line 257, in main\n  File \"/var/folders/rv/3qvskvh554n0dc38n7zjczx80000gp/T/ansible_netbox_device_interface_payload_dou7dyb9/ansible_netbox_device_interface_payload.zip/ansible_collections/netbox_community/ansible_modules/plugins/module_utils/netbox_dcim.py\", line 97, in run\n  File \"/usr/local/lib/python3.7/site-packages/pynetbox/core/endpoint.py\", line 159, in get\n    return self._response_loader(req.get())\n  File \"/usr/local/lib/python3.7/site-packages/pynetbox/core/query.py\", line 300, in get\n    return req_all()\n  File \"/usr/local/lib/python3.7/site-packages/pynetbox/core/query.py\", line 279, in req_all\n    req = self._make_call(add_params=add_params)\n  File \"/usr/local/lib/python3.7/site-packages/pynetbox/core/query.py\", line 263, in _make_call\n    raise RequestError(req)\npynetbox.core.query.RequestError: The requested url: http://localhost:32768/api/dcim/interfaces/3/ could not be found.\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
@FragmentedPacket
Copy link
Contributor

@tkspuk Could you try the PR attached to this and let me know if that fixes your issue?

@tkspuk
Copy link
Author

tkspuk commented Feb 25, 2020

@FragmentedPacket Let me test it quickly

@tkspuk
Copy link
Author

tkspuk commented Feb 25, 2020

@FragmentedPacket That's great, the new PR is working normally.thank you,I will close this issue

@tkspuk tkspuk closed this as completed Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR Submitted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants