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

Python library openstacksdk not working with versions 5.x #127

Closed
raddiana opened this issue Jun 29, 2021 · 3 comments
Closed

Python library openstacksdk not working with versions 5.x #127

raddiana opened this issue Jun 29, 2021 · 3 comments

Comments

@raddiana
Copy link

Hello,

Using openstacksdk to manage our infrastructure, we have noticed it does not work as expected with versions 5.x.
Here you can find the decorator that breaks: https://github.com/openstack/openstacksdk/blob/master/openstack/cloud/_utils.py#L387
For this function: https://github.com/openstack/openstacksdk/blob/master/openstack/cloud/_identity.py#L35

And this is the error we are getting:

Traceback (most recent call last):
  File "<stdin>", line 102, in <module>
  File "<stdin>", line 94, in _ansiballz_main
  File "<stdin>", line 40, in invoke_module
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 210, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/var/folders/1b/ygqhxjg14_n4pgzh9p4t85tm0000gp/T/ansible_openstack.cloud.project_payload_e26ycasd/ansible_openstack.cloud.project_payload.zip/ansible_collections/openstack/cloud/plugins/modules/project.py", line 220, in <module>
  File "/var/folders/1b/ygqhxjg14_n4pgzh9p4t85tm0000gp/T/ansible_openstack.cloud.project_payload_e26ycasd/ansible_openstack.cloud.project_payload.zip/ansible_collections/openstack/cloud/plugins/modules/project.py", line 216, in main
  File "/var/folders/1b/ygqhxjg14_n4pgzh9p4t85tm0000gp/T/ansible_openstack.cloud.project_payload_e26ycasd/ansible_openstack.cloud.project_payload.zip/ansible_collections/openstack/cloud/plugins/module_utils/openstack.py", line 406, in __call__
  File "/var/folders/1b/ygqhxjg14_n4pgzh9p4t85tm0000gp/T/ansible_openstack.cloud.project_payload_e26ycasd/ansible_openstack.cloud.project_payload.zip/ansible_collections/openstack/cloud/plugins/modules/project.py", line 173, in run
  File "/Users/radd/Projects/infra2/decorator-error/lib/python3.9/site-packages/openstack/cloud/_identity.py", line 110, in get_project
    return _utils._get_entity(self, 'project', name_or_id, filters,
  File "/Users/radd/Projects/infra2/decorator-error/lib/python3.9/site-packages/openstack/cloud/_utils.py", line 204, in _get_entity
    entities = search(name_or_id, filters, **kwargs)
  File "/Users/radd/Projects/infra2/decorator-error/lib/python3.9/site-packages/openstack/cloud/_identity.py", line 91, in search_projects
    return self.list_projects(
  File "/Users/radd/Projects/infra2/decorator-error/lib/python3.9/site-packages/openstack/cloud/_utils.py", line 412, in _cache_decorator
    wtf = the_method(*args, **kwargs)
  File "/Users/radd/Projects/infra2/decorator-error/lib/python3.9/site-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "/Users/radd/Projects/infra2/decorator-error/lib/python3.9/site-packages/dogpile/cache/region.py", line 1584, in get_or_create_for_user_func
    key = key_generator(*arg, **kw)
  File "/Users/radd/Projects/infra2/decorator-error/lib/python3.9/site-packages/openstack/cloud/openstackcloud.py", line 334, in generate_key
    arg_key = ','.join(args)
TypeError: sequence item 2: expected str instance, NoneType found
@micheles
Copy link
Owner

micheles commented Jul 2, 2021

What I need is a self-contained small script that exhibits the error.

@micheles
Copy link
Owner

micheles commented Sep 11, 2021

Using decoratorx introduced in 5.1.0 could help in your case too (see #129).

@micheles
Copy link
Owner

micheles commented Jan 7, 2022

Closing since I did not hear any more feedback in 6+ months.

@micheles micheles closed this as completed Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants