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

added additional data for TNMS fibre info

parent bf5d3627
No related branches found
No related tags found
No related merge requests found
......@@ -754,6 +754,9 @@ def update_circuit_hierarchy_and_port_id_services(self, use_current=False):
s.pop('port_a_id', None)
s.pop('port_b_id', None)
# using a dict to ensure no duplicates
node_pair_services = defaultdict(dict)
for key, value in port_id_details.items():
for details in value:
k = f"{details['equipment_name']}:" \
......@@ -784,6 +787,10 @@ def update_circuit_hierarchy_and_port_id_services(self, use_current=False):
type_services = services_by_type.setdefault(
ims_sorted_service_type_key(circ['service_type']), dict())
type_services[circ['id']] = circ
if circ['other_end_equipment']:
node_pair_services[
f"{circ['equipment']}/{circ['other_end_equipment']}"
][circ['id']] = circ
interface_services[k].extend(circuits)
......@@ -800,6 +807,10 @@ def update_circuit_hierarchy_and_port_id_services(self, use_current=False):
rp.delete(k)
rp.execute()
rp = r.pipeline()
for k in r.scan_iter('ims:node_pair_services:*', count=1000):
rp.delete(k)
rp.execute()
rp = r.pipeline()
for k in r.scan_iter('ims:access_services:*', count=1000):
rp.delete(k)
for k in r.scan_iter('ims:gws_indirect:*', count=1000):
......@@ -816,6 +827,12 @@ def update_circuit_hierarchy_and_port_id_services(self, use_current=False):
json.dumps(v))
rp.execute()
rp = r.pipeline()
for k, v in node_pair_services.items():
rp.set(
f'ims:node_pair_services:{k}',
json.dumps(list(v.values())))
rp.execute()
rp = r.pipeline()
populate_poller_cache(interface_services, r)
......
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