Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Error when no ssids are returned #90

Closed
nniehoff opened this issue May 18, 2022 · 0 comments · Fixed by #91
Closed

Error when no ssids are returned #90

nniehoff opened this issue May 18, 2022 · 0 comments · Fixed by #91

Comments

@nniehoff
Copy link
Contributor

Environment

  • Python version: 3.7
  • Nautobot version: 1.3
  • ipfabric version: latest

When no wireless ssids are returned from the API the following stack trace appears in the worker:

[2022-05-18 12:23:51,172: ERROR/ForkPoolWorker-2] Task nautobot_chatops.utils.celery_worker_task[b567414b-a44c-4bd5-8b0f-014717d03220] raised unexpected: AttributeError("'NoneType' object has no attribute 'lower'")
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops/utils.py", line 40, in celery_worker_task
    return function(
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops_ipfabric/worker.py", line 66, in ipfabric
    return handle_subcommands("ipfabric", subcommand, **kwargs)
  File "<decorator-gen-1>", line 2, in handle_subcommands
  File "/usr/local/lib/python3.10/site-packages/prometheus_client/context_managers.py", line 81, in wrapped
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops/workers/__init__.py", line 298, in handle_subcommands
    result = registry[command]["subcommands"][subcommand]["worker"](dispatcher, *params)
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops/workers/__init__.py", line 187, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops_ipfabric/worker.py", line 692, in wireless
    ssids = [(ssidi["wlanSsid"].lower()) for ssidi in ipfabric_api.get_wireless_ssids(snapshot_id)]
  File "/usr/local/lib/python3.10/site-packages/nautobot_chatops_ipfabric/worker.py", line 692, in <listcomp>
    ssids = [(ssidi["wlanSsid"].lower()) for ssidi in ipfabric_api.get_wireless_ssids(snapshot_id)]
AttributeError: 'NoneType' object has no attribute 'lower'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant