-
Notifications
You must be signed in to change notification settings - Fork 29
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
gns3fy does not appear to be compatible with pydantic 1.10.0 #107
Comments
I have no idea about gns3fy or pydantic, but I bodged in a fix and it seems to work, I would assume that pydantic change from using initialised to pydantic_initialised recently, and gns3fy needed to be updated |
Thanks for the description of the problem, downgrading helps indeed. I went ahead and pinned the
|
Would you do a pull request for the fix ? |
@Domoninic I have opened a pull request for this issue. |
Your fix misses one occurrence, I open a pull request to included all occurrences. |
@Domoninic Just added the missing part, before I saw your comment. |
downgrading pydantic to 1.9.x works fine. it appears that pydantic is adding a field (
__pydantic_initialised__
) to dicts that are subsequently serialized to json and sent to the gns3 server which errors on the additional unexpected fields.a sample of the error message thrown:
TASK [davidban77.gns3.create_lab : Create Project] **************************************************************************************
task path: /Users/pfelt/Projects/gns3_labs/ansible_collections/davidban77/gns3/roles/create_lab/tasks/main.yml:2
The full traceback is:
Traceback (most recent call last):
File "/Users/pfelt/Library/Python/3.8/lib/python/site-packages/gns3fy/gns3fy.py", line 141, in http_call
_response.raise_for_status()
File "/Users/pfelt/Library/Python/3.8/lib/python/site-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://192.168.122.89:80/v2/projects
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/pfelt/.ansible/tmp/ansible-tmp-1662489418.9695628-94710-141604783353771/AnsiballZ_gns3_project.py", line 100, in
_ansiballz_main()
File "/Users/pfelt/.ansible/tmp/ansible-tmp-1662489418.9695628-94710-141604783353771/AnsiballZ_gns3_project.py", line 92, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/Users/pfelt/.ansible/tmp/ansible-tmp-1662489418.9695628-94710-141604783353771/AnsiballZ_gns3_project.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible_collections.davidban77.gns3.plugins.modules.gns3_project', init_globals=dict(_module_fqn='ansible_collections.davidban77.gns3.plugins.modules.gns3_project', _modlib_path=modlib_path),
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 207, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/var/folders/l5/vx4f7wdn73ng3kv4k_4k6l900000gq/T/ansible_gns3_project_payload_krb97usq/ansible_gns3_project_payload.zip/ansible_collections/davidban77/gns3/plugins/modules/gns3_project.py", line 437, in
File "/var/folders/l5/vx4f7wdn73ng3kv4k_4k6l900000gq/T/ansible_gns3_project_payload_krb97usq/ansible_gns3_project_payload.zip/ansible_collections/davidban77/gns3/plugins/modules/gns3_project.py", line 409, in main
File "/Users/pfelt/Library/Python/3.8/lib/python/site-packages/gns3fy/gns3fy.py", line 1264, in create
_response = self.connector.http_call("post", _url, json_data=data)
File "/Users/pfelt/Library/Python/3.8/lib/python/site-packages/gns3fy/gns3fy.py", line 143, in http_call
raise HTTPError(
requests.exceptions.HTTPError: 400: JSON schema error with API request '/v2/projects' and JSON data '{'name': 'pgf2RockiesLab-ceos', 'pydantic_initialised': True}': Additional properties are not allowed ('pydantic_initialised' was unexpected)
fatal: [localhost]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File "/Users/pfelt/Library/Python/3.8/lib/python/site-packages/gns3fy/gns3fy.py", line 141, in http_call\n _response.raise_for_status()\n File "/Users/pfelt/Library/Python/3.8/lib/python/site-packages/requests/models.py", line 943, in raise_for_status\n raise HTTPError(http_error_msg, response=self)\nrequests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://192.168.122.89:80/v2/projects\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/Users/pfelt/.ansible/tmp/ansible-tmp-1662489418.9695628-94710-141604783353771/AnsiballZ_gns3_project.py", line 100, in \n _ansiballz_main()\n File "/Users/pfelt/.ansible/tmp/ansible-tmp-1662489418.9695628-94710-141604783353771/AnsiballZ_gns3_project.py", line 92, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/Users/pfelt/.ansible/tmp/ansible-tmp-1662489418.9695628-94710-141604783353771/AnsiballZ_gns3_project.py", line 40, in invoke_module\n runpy.run_module(mod_name='ansible_collections.davidban77.gns3.plugins.modules.gns3_project', init_globals=dict(_module_fqn='ansible_collections.davidban77.gns3.plugins.modules.gns3_project', _modlib_path=modlib_path),\n File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 87, in _run_code\n exec(code, run_globals)\n File "/var/folders/l5/vx4f7wdn73ng3kv4k_4k6l900000gq/T/ansible_gns3_project_payload_krb97usq/ansible_gns3_project_payload.zip/ansible_collections/davidban77/gns3/plugins/modules/gns3_project.py", line 437, in \n File "/var/folders/l5/vx4f7wdn73ng3kv4k_4k6l900000gq/T/ansible_gns3_project_payload_krb97usq/ansible_gns3_project_payload.zip/ansible_collections/davidban77/gns3/plugins/modules/gns3_project.py", line 409, in main\n File "/Users/pfelt/Library/Python/3.8/lib/python/site-packages/gns3fy/gns3fy.py", line 1264, in create\n _response = self.connector.http_call("post", _url, json_data=data)\n File "/Users/pfelt/Library/Python/3.8/lib/python/site-packages/gns3fy/gns3fy.py", line 143, in http_call\n raise HTTPError(\nrequests.exceptions.HTTPError: 400: JSON schema error with API request '/v2/projects' and JSON data '{'name': 'pgf2RockiesLab-ceos', 'pydantic_initialised': True}': Additional properties are not allowed ('pydantic_initialised' was unexpected)\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
PLAY RECAP ******************************************************************************************************************************
localhost : ok=5 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
bash-3.2$
The text was updated successfully, but these errors were encountered: