Skip to content
Snippets Groups Projects
Commit d4b7c8d7 authored by Andrea Sgambelluri's avatar Andrea Sgambelluri
Browse files

bug fix in delete

parent 1524d8bb
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!284Resolve: "(CNIT) Multi-Granular Optical Nodes and Optical Transpoders management"
{"1": {"optical_band_id": 1, "bidir": 0, "src": "R1", "dst": "R2", "flows": {"R1": {"f": {"in": "0", "out": "port-1-out"}, "b": {}}, "R2": {"f": {"in": "port-1-in", "out": "0"}, "b": {}}}, "band_type": "c_slots", "fiber_forward": {}, "fiber_backward": {}, "op-mode": 0, "n_slots": 16, "links": ["R1-R2"], "path": ["R1", "R2"], "band": 200000, "freq": 192106250, "is_active": false, "src_port": "port-1-out", "dst_port": "port-1-in", "rev_dst_port": "port-1-in", "rev_src_port": "port-1-out", "c_slots": {"1": 1, "2": 1, "3": 1, "4": 1, "5": 1, "6": 1, "7": 1, "8": 1, "9": 1, "10": 1, "11": 1, "12": 1, "13": 1, "14": 1, "15": 1, "16": 1}, "served_lightpaths": []}, "2": {"optical_band_id": 2, "bidir": 0, "src": "R1", "dst": "R2", "flows": {"R1": {"f": {"in": "0", "out": "port-1-out"}, "b": {}}, "R2": {"f": {"in": "port-1-in", "out": "0"}, "b": {}}}, "band_type": "c_slots", "fiber_forward": {}, "fiber_backward": {}, "op-mode": 0, "n_slots": 16, "links": ["R1-R2"], "path": ["R1", "R2"], "band": 200000, "freq": 192106250, "is_active": true, "src_port": "port-1-out", "dst_port": "port-1-in", "rev_dst_port": "port-1-in", "rev_src_port": "port-1-out", "c_slots": {"1": 0, "2": 0, "3": 0, "4": 0, "5": 0, "6": 0, "7": 0, "8": 0, "9": 0, "10": 0, "11": 0, "12": 0, "13": 0, "14": 0, "15": 0, "16": 0}, "served_lightpaths": [2, 3]}}
dev.logs 0 → 100644
This diff is collapsed.
This diff is collapsed.
......@@ -328,6 +328,8 @@ class RSA():
path = flow["path"]
links = flow["links"]
bidir = flow["bidir"]
flow_id = flow["flow_id"]
for l in links:
if debug:
......@@ -357,6 +359,10 @@ class RSA():
print("restoring OB")
print(f"invoking restore_optical_band o_b_id: {o_b_id} , slots {slots} , band {band} ")
self.restore_optical_band(o_b_id, slots, band)
if flow_id in self.optical_bands[o_b_id]["served_lightpaths"]:
if flow_id in self.optical_bands[o_b_id]["served_lightpaths"]:
self.optical_bands[o_b_id]["served_lightpaths"].remove(flow_id)
#self.restore_optical_band_2(o_b_id, slots, band,links)
if bidir:
for l in links:
......@@ -395,6 +401,9 @@ class RSA():
def del_band(self, flow,flow_id, o_b_id = None):
print(f"delete band {flow} ")
if len(self.optical_bands[o_b_id]["served_lightpaths"])>0:
return False
flows = flow["flows"]
band = None
slots = flow["slots"]
......@@ -425,8 +434,6 @@ class RSA():
print(f"invoking restore_link_2 fib: {fib} , slots {slots} , band {band} ")
self.restore_link(fib, slots, band)
self.optical_bands[o_b_id]["is_active"]=False
if flow_id in self.optical_bands[o_b_id]["served_lightpaths"]:
self.optical_bands[o_b_id]["served_lightpaths"].remove(flow_id)
if debug:
print(fib[band])
......
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