You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that there was a deprecation in the collections lib.
When using reclass with python 3.10+ I do get the following error.
AttributeError: module 'collections' has no attribute 'Iterable'
Did a quick google search and found a workaround.
Let me know what you think. I could create a PR.
reclass/values/parser_funcs.py
11c11,15
< import collections
---
> try:
> from collections.abc import Iterable
> except ImportError:
> from collections import Iterable
>
52c56
< if (isinstance(w, collections.Iterable) and
---
> if (isinstance(w, Iterable) and
╰─ reclass -n node01 -b .
Traceback (most recent call last):
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/storage/memcache_proxy.py", line 51, in get_class
return self._classes_cache[environment][name]
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'base'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sharky/.pyenv/versions/py3110_network_automation/bin/reclass", line 33, in <module>
sys.exit(load_entry_point('reclass==1.7.0', 'console_scripts', 'reclass')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/cli.py", line 44, in main
data = reclass.nodeinfo(options.nodename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/core.py", line 272, in nodeinfo
return self._nodeinfo_as_dict(nodename, self._nodeinfo(nodename, None))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/core.py", line 250, in _nodeinfo
node = self._node_entity(nodename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/core.py", line 245, in _node_entity
return self._recurse_entity(node_entity, merge_base=merge_base, context=merge_base, seen=seen,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/core.py", line 135, in _recurse_entity
class_entity = self._storage.get_class(klass, environment, self._settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/storage/memcache_proxy.py", line 55, in get_class
ret = self._real_storage.get_class(name, environment, settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/storage/yaml_fs/__init__.py", line 111, in get_class
entity = YamlData.from_file(path).get_entity(name, pathname, settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/storage/yamldata.py", line 98, in get_entity
parameters = datatypes.Parameters(parameters, settings, self._uri)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/datatypes/parameters.py", line 67, in __init__
self.merge(mapping)
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/datatypes/parameters.py", line 234, in merge
wrapped = self._wrap_dict(other)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/datatypes/parameters.py", line 124, in _wrap_dict
d[k] = self._get_wrapped(k, v)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/datatypes/parameters.py", line 110, in _get_wrapped
return self._wrap_value(value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/datatypes/parameters.py", line 97, in _wrap_value
return self._wrap_dict(value)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/datatypes/parameters.py", line 124, in _wrap_dict
d[k] = self._get_wrapped(k, v)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/datatypes/parameters.py", line 110, in _get_wrapped
return self._wrap_value(value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/datatypes/parameters.py", line 97, in _wrap_value
return self._wrap_dict(value)
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/datatypes/parameters.py", line 124, in _wrap_dict
d[k] = self._get_wrapped(k, v)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/datatypes/parameters.py", line 110, in _get_wrapped
return self._wrap_value(value)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/datatypes/parameters.py", line 102, in _wrap_value
return Value(value, self._settings, self._uri,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/values/value.py", line 31, in __init__
self._item = self._parser.parse(value, self._settings)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/values/parser.py", line 68, in parse
tokens = parsers.listify(tokens)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sharky/.pyenv/versions/py3110_network_automation/lib/python3.11/site-packages/reclass/values/parser_funcs.py", line 52, in listify
if (isinstance(w, collections.Iterable) and
^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'Iterable'
The text was updated successfully, but these errors were encountered:
Hey !
It seems that there was a deprecation in the collections lib.
When using reclass with python 3.10+ I do get the following error.
Did a quick google search and found a workaround.
Let me know what you think. I could create a PR.
reclass/values/parser_funcs.py
The text was updated successfully, but these errors were encountered: