Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getOrganizationWirelessSsidsStatusesByDevice KeyError #270

Open
sloweclair opened this issue Nov 8, 2024 · 0 comments
Open

getOrganizationWirelessSsidsStatusesByDevice KeyError #270

sloweclair opened this issue Nov 8, 2024 · 0 comments

Comments

@sloweclair
Copy link

Describe how you confirmed the issue is with the library, and not with the API itself, or a server-side issue of some other kind.
The python library is trying to read pageEndAt when it isn't there in a response

Python version installed
3.12.4

Meraki library version installed
1.51.0

Have you reproduced the issue with the latest version of this library? And with the latest version of Python?
Yes

OS Platform
Windows 11

Describe the bug
The getOrganizationWirelessSsidsStatusesByDevice crashes when there is more than 1 page. It is trying to read pageEndAt from the response.json() but it isn't there.

Traceback (most recent call last):
  File "meraki-bug-check\crash.py", line 5, in <module>
    data = dashboard.wireless.getOrganizationWirelessSsidsStatusesByDevice(<redacted>, total_pages=-1, networkIds=['<redacted>'], perPage=500)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "meraki-bug-check\.venv\Lib\site-packages\meraki\api\wireless.py", line 3018, in getOrganizationWirelessSsidsStatusesByDevice
    return self._session.get_pages(metadata, resource, params, total_pages, direction)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "meraki-bug-check\.venv\Lib\site-packages\meraki\rest_session.py", line 457, in _get_pages_legacy
    end = response.json()['pageEndAt']
          ~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'pageEndAt'

How can we replicate the problem you're reporting?
Run the code snippet below. It will crash as long as it is requesting more than 1 page

Expected behavior
Not crash

Code snippets

import meraki
dashboard = meraki.DashboardAPI()
data = dashboard.wireless.getOrganizationWirelessSsidsStatusesByDevice(<redacted>, total_pages=-1, networkIds=['<redacted>'], perPage=100)
print(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant