Skip to content
Snippets Groups Projects
Commit 8df9af0c authored by famelis's avatar famelis Committed by Vasilis Katopodis
Browse files

fix: Check if endpoints returned are None

parent 40fd6903
No related branches found
No related tags found
2 merge requests!54Release 2.0.0,!51fix (automation): Add field 'name' in Device protobuf message
......@@ -83,6 +83,7 @@ def populate_endpoints(device : Device, driver : _Driver, monitoring_loops : Mon
results_getconfig = driver.GetConfig(resources_to_get)
errors : List[str] = list()
LOGGER.warning(results_getconfig)
for endpoint in results_getconfig:
if len(endpoint) != 2:
errors.append(ERROR_BAD_ENDPOINT.format(device_uuid, str(endpoint)))
......@@ -92,6 +93,8 @@ def populate_endpoints(device : Device, driver : _Driver, monitoring_loops : Mon
if isinstance(resource_value, Exception):
errors.append(ERROR_GET.format(device_uuid, str(resource_key), str(resource_value)))
continue
if resource_value is None:
continue
endpoint_uuid = resource_value.get('uuid')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment