napalm-automation / napalm-logs

Cross-vendor normalisation for network syslog messages, following the OpenConfig and IETF YANG models
https://napalm-logs.readthedocs.io/en/latest/
Apache License 2.0
141 stars 44 forks source link

collections.Mapping should be collections.abc.Mapping #370

Closed jeffmcadams closed 1 year ago

jeffmcadams commented 2 years ago

Apparently the "correct" way to call Mapping in the collections module is by using collections.abc.Mapping. collections.Mapping was deprecated for quite some time, apparently, and removed in python 3.10

$ napalm-logs --disable-security --publisher=cli --hwm=0
Traceback (most recent call last):
  File "/root/python/napalm-logs/bin/napalm-logs", line 8, in <module>
    sys.exit(napalm_logs_engine())
  File "/root/python/napalm-logs/lib/python3.10/site-packages/napalm_logs/scripts/cli.py", line 458, in napalm_logs_engine
    nl = napalm_logs.NapalmLogs(**config)
  File "/root/python/napalm-logs/lib/python3.10/site-packages/napalm_logs/base.py", line 118, in __init__
    self._build_config()
  File "/root/python/napalm-logs/lib/python3.10/site-packages/napalm_logs/base.py", line 541, in _build_config
    self.config_dict = self._load_config(self.config_path)
  File "/root/python/napalm-logs/lib/python3.10/site-packages/napalm_logs/base.py", line 323, in _load_config
    napalm_logs.utils.dictupdate(config[os_name], cfg)
  File "/root/python/napalm-logs/lib/python3.10/site-packages/napalm_logs/utils/__init__.py", line 347, in dictupdate
    if (not isinstance(dest, collections.Mapping)) or (
AttributeError: module 'collections' has no attribute 'Mapping'