Hi
When running the following code, if the update was successful, I get the expected JSON response of the port configuration as it is after the update was successful.
However, if the update wasn't successful, for example I get the stpGuard option an invalid option, the new_port_config variable doesn't get create. Can I presume then, that there is no response if the update was unsuccessful and therefore I only need to check that the new_port_config exists, rather than checking against any articular content of the response?
for port in switch_ports[1:2]:
if port['type'] == 'access':
# New port configuration change
switch_port_conf = {
'rstpEnabled': False,
'stpGuard': 'bpdu guard'
}
# Update switchport with new config
try:
new_port_config = dashboard.switch.updateDeviceSwitchPort(switch['serial'], port['portId'], **switch_port_conf)
except meraki.APIError as e:
meraki_error(e)
except Exception as e:
other_error(e)