- return data['notifications'][0]['updates']['addrWithMask']['value'].split('/')[0]
- except Exception:
- raise SdnConnectorError("Invalid response from url {}: data {}".format(url, data))
+ if data['notifications']:
+ for notification in data['notifications']:
+ for update in notification['updates']:
+ if update == 'addrWithMask':
+ return notification['updates'][update]['value']
+ except Exception as e:
+ raise SdnConnectorError("Invalid response from url {}: data {} - {}".format(url, data, str(e)))
+ raise SdnConnectorError("Unable to get ip for interface {} in device {}, data {}".
+ format(interface, device_id, data))