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

Add fix for assigning correct port SIDs to circuits

parent c5aca7b9
Branches
Tags
1 merge request!7Add fix for assigning correct port SIDs to circuits
...@@ -1110,16 +1110,25 @@ def transform_ims_data(data): ...@@ -1110,16 +1110,25 @@ def transform_ims_data(data):
node_pair_services[ node_pair_services[
f"{circ['equipment']}/{circ['other_end_equipment']}" f"{circ['equipment']}/{circ['other_end_equipment']}"
][circ['id']] = circ ][circ['id']] = circ
try:
# get the physical port circuit, if it exists
# https://jira.software.geant.org/browse/POL1-687
port_circuit = next(
c for c in circuits if c.get('port_type') == 'ports')
except StopIteration:
port_circuit = None
sid = None sid = None
if circ['id'] in circuit_ids_and_sids: if circ['id'] in circuit_ids_and_sids:
sid = circuit_ids_and_sids[circ['id']] sid = circuit_ids_and_sids[circ['id']]
elif 'sid' in details: elif 'sid' in details:
if len(circuits) > 1: if len(circuits) > 1:
# we don't know which circuit if port_circuit != circ:
# to give the SID in this case, so skip # we don't know which circuit
continue # to give the SID in this case, so skip
continue
# assign the SID from the port to this circuit
sid = details['sid'] sid = details['sid']
if sid is None: if sid is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment