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

Fixing No ssidis returned #91

merged 5 commits into from
May 20, 2022

Conversation

nniehoff
Copy link
Contributor

Fixes: #90

Copy link
Contributor

@chadell chadell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

check if ssids are returned before returning them.
Copy link
Contributor Author

@nniehoff nniehoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ubajze
Copy link
Contributor

ubajze commented May 19, 2022

@nniehoff @chadell @scetron

I am not sure that this solves the issue completely. I think it just postpones the problem.
The wireless function calls one of two functions later in code:

cmd_map = {"clients": get_wireless_clients, "ssids": get_wireless_ssids}
cmd_map[option](dispatcher, ssid, snapshot_id)

There we have two similar lines as before:

ssids = [(ssid_["wlanSsid"].lower()) for ssid_ in ipfabric_api.get_wireless_ssids(snapshot_id)]

ssids = [
(f"{ssid_['wlanSsid']}-{ssid_['radioDscr']}", ssid_["wlanSsid"])
for ssid_ in ipfabric_api.get_wireless_ssids(snapshot_id)
]

I am pretty sure we can update the first line similarly.

The second needs a different fix.
The original problem comes because the wlanSsid entry is None.

>>> print(json.dumps(rj, indent=4))
[
    {
        "wlanSsid": null,                <------------------ This
        "siteName": "HWLAB"
    },
    {
        "wlanSsid": "ipf-lab-aruba-wlc620",
        "siteName": "HWLAB"
    },

I am not sure how to test this properly in our lab.

@ubajze
Copy link
Contributor

ubajze commented May 19, 2022

I added some updates, but I am not sure if we can test that in our environment. I checked and we don't have any radio without the SSID in our IPFabric snapshot.

Copy link
Contributor

@pke11y pke11y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good

@pke11y pke11y merged commit 9bbf0cc into nautobot:develop May 20, 2022
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 this pull request may close these issues.

Error when no ssids are returned
5 participants