Skip to content
Snippets Groups Projects
Commit 84d0c1cc authored by Robert Latta's avatar Robert Latta
Browse files

changed _location_from_service_dict to call _location_from_router

parent 1cf500b6
No related branches found
No related tags found
No related merge requests found
......@@ -53,22 +53,37 @@ def _location_from_router(router_name):
}
# todo - see if Erik is happy for this to
# just make a call to _location_from_router
def _location_from_service_dict(s):
loc = _location_from_router(s['equipment'])
location = {
'a': _LOCATION(
equipment=s['equipment'],
name=s['pop_name'],
abbreviation=s['pop_abbreviation'])
equipment=loc['a']['equipment'],
name=loc['a']['pop_name'],
abbreviation=loc['a']['pop_abbreviation'])
}
if all(s[n] for n in (
'other_end_equipment',
'other_end_pop_name',
'other_end_pop_abbreviation')):
if 'other_end_equipment' in s:
loc = _location_from_router(s['other_end_equipment'])
location['b'] = _LOCATION(
equipment=s['other_end_equipment'],
name=s['other_end_pop_name'],
abbreviation=s['other_end_pop_abbreviation'])
equipment=loc['a']['equipment'],
name=loc['a']['pop_name'],
abbreviation=loc['a']['abbreviation'])
# location = {
# 'a': _LOCATION(
# equipment=s['equipment'],
# name=s['pop_name'],
# abbreviation=s['pop_abbreviation'])
# }
#
# if all(s[n] for n in (
# 'other_end_equipment',
# 'other_end_pop_name',
# 'other_end_pop_abbreviation')):
# location['b'] = _LOCATION(
# equipment=s['other_end_equipment'],
# name=s['other_end_pop_name'],
# abbreviation=s['other_end_pop_abbreviation'])
return location
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment