Skip to content

Issues on example script "org_wide_clients_v1.py" #297

@abhimukherjee91

Description

@abhimukherjee91

While exploring the script observed that the CSV header variable in line 86 does not contains all the fields

Due to this the org wide csv creation will get failed while individual network wise csv creation would get successful.

Traceback details:
Traceback (most recent call last):
File "d:\meraki_clients\client_details.py", line 111, in
main()
File "d:\am_pg\test_playbooks\meraki_clients\client_details.py", line 106, in main
csv_writer.writerow(row)
File "C:\Python312\Lib\csv.py", line 164, in writerow
return self.writer.writerow(self._dict_to_list(rowdict))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\csv.py", line 159, in _dict_to_list
raise ValueError("dict contains fields not in fieldnames: "
ValueError: dict contains fields not in fieldnames: 'deviceTypePrediction', 'mcgSerial', 'mcgNodeMac', 'wirelessCapabilities', 'pskGroup', 'mcgNodeName', 'mcgNetworkId', 'recentDeviceConnection', 'ad
aptivePolicyGroup'

Rectification required:
change the variable in line 86 as following,

field_names = ['id', 'mac', 'description', 'ip', 'ip6', 'ip6Local', 'user', 'firstSeen', 'lastSeen',
'manufacturer', 'os', 'deviceTypePrediction', 'recentDeviceSerial', 'recentDeviceName', 'recentDeviceMac', 'recentDeviceConnection', 'ssid',
'vlan', 'switchport', 'usage', 'status', 'notes', 'groupPolicy8021x', 'adaptivePolicyGroup', 'smInstalled','pskGroup', 'wirelessCapabilities', 'mcgSerial', 'mcgNodeName', 'mcgNodeMac', 'mcgNetworkId']

Python version installed
tested on 3.12

Meraki library version installed
2.0.2

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

OS Platform
Windows 11

Describe the bug
Traceback details:
Traceback (most recent call last):
File "d:\meraki_clients\client_details.py", line 111, in
main()
File "d:\am_pg\test_playbooks\meraki_clients\client_details.py", line 106, in main
csv_writer.writerow(row)
File "C:\Python312\Lib\csv.py", line 164, in writerow
return self.writer.writerow(self._dict_to_list(rowdict))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\csv.py", line 159, in _dict_to_list
raise ValueError("dict contains fields not in fieldnames: "
ValueError: dict contains fields not in fieldnames: 'deviceTypePrediction', 'mcgSerial', 'mcgNodeMac', 'wirelessCapabilities', 'pskGroup', 'mcgNodeName', 'mcgNetworkId', 'recentDeviceConnection', 'ad
aptivePolicyGroup'

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions