Skip to content
Snippets Groups Projects
Commit 10213a98 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Fix a bug in _get_speed breaking the IMS task.

Also add logger.exception call to show stack trace in the future.
parent ae80aabe
Branches
Tags
No related merge requests found
......@@ -760,8 +760,8 @@ def ims_task(self, use_current=False):
transformed_data = transform_ims_data(extracted_data)
persist_ims_data(transformed_data, use_current)
except Exception as e:
logger.error(e)
except Exception:
logger.exception('Error in IMS task:')
update_latch_status(InventoryTask.config, pending=True, failure=True)
......@@ -1014,7 +1014,9 @@ def transform_ims_data(data):
return int(value) * conversions[unit]
def _get_speed(circuit_id):
c = hierarchy[circuit_id]
c = hierarchy.get(circuit_id)
if c is None:
return 0
if c['status'] != 'operational':
return 0
pattern = re.compile(r'^(\d+)([a-zA-z]+)$')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment