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

Fixing No ssidis returned #91

Merged
merged 5 commits into from
May 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions nautobot_chatops_ipfabric/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def wireless(dispatcher, option=None, ssid=None):
"""Get wireless information by client or ssid."""
snapshot_id = get_user_snapshot(dispatcher)
logger.debug("Getting SSIDs")
ssids = [(ssidi["wlanSsid"].lower()) for ssidi in ipfabric_api.get_wireless_ssids(snapshot_id)]
ssids = ipfabric_api.get_wireless_ssids(snapshot_id)

if not ssids:
dispatcher.send_blocks(
Expand Down Expand Up @@ -722,7 +722,7 @@ def wireless(dispatcher, option=None, ssid=None):

def get_wireless_ssids(dispatcher, ssid=None, snapshot_id=None):
"""Get All Wireless SSID Information."""
ssids = [(ssid_["wlanSsid"].lower()) for ssid_ in ipfabric_api.get_wireless_ssids(snapshot_id)]
ssids = ipfabric_api.get_wireless_ssids(snapshot_id)
if not ssids:
dispatcher.send_blocks(
[
Expand All @@ -738,8 +738,6 @@ def get_wireless_ssids(dispatcher, ssid=None, snapshot_id=None):
)
return True

ssids = ipfabric_api.get_wireless_ssids(snapshot_id)

dispatcher.send_blocks(
[
*dispatcher.command_response_header(
Expand Down Expand Up @@ -781,6 +779,7 @@ def get_wireless_clients(dispatcher, ssid=None, snapshot_id=None):
ssids = [
(f"{ssid_['wlanSsid']}-{ssid_['radioDscr']}", ssid_["wlanSsid"])
for ssid_ in ipfabric_api.get_wireless_ssids(snapshot_id)
if ssid_["wlanSsid"]
]
if not ssids:
dispatcher.send_blocks(
Expand Down