Loading src/opticalcontroller/RSA.py +9 −29 Original line number Diff line number Diff line Loading @@ -269,15 +269,6 @@ class RSA(): print(f"fib updated {fib}") #print(fib) def update_link_2(self, fib, slots, band): #print(fib) for i in slots: fib[band][str(i)] = 0 if 'used' in fib: fib['used'] = True def update_optical_band(self, optical_band_id, slots, band): for i in slots: self.optical_bands[optical_band_id][band][str(i)] = 0 Loading @@ -293,18 +284,9 @@ class RSA(): fib['used'] = False #fib[band].sort() def restore_link_2(self, fib, slots, band): for i in slots: fib[band][str(i)] = 1 if 'used' in fib: fib['used'] = False def restore_optical_band(self, optical_band_id, slots, band): for i in slots: self.optical_bands[optical_band_id][band][str(i)] = 1 #self.optical_bands[optical_band_id][band].append(int(i)) #self.optical_bands[optical_band_id][band].sort() Loading Loading @@ -366,7 +348,7 @@ class RSA(): # fib = link['fibers'][f] fib = self.get_link_by_name(r_l)["optical_details"] if list_in_list(slots, str_list_to_int(fib[band].keys())): self.restore_link_2(fib, slots, band, link=l) self.restore_link(fib, slots, band) if debug: print(fib[band]) ''' Loading @@ -379,7 +361,7 @@ class RSA(): #rfib = rlink['fibers'][rf] rfib = self.get_fiber_details(rl, fiber_b[rl]) if not list_in_list(slots, rfib[band]): self.restore_link_2(rfib, slots, band) self.restore_link(rfib, slots, band) if debug: print(rfib[band]) ''' Loading Loading @@ -420,8 +402,8 @@ class RSA(): print(f"del_flow_fib {fib } and band {band}") print(f"del_flow { str_list_to_int(fib[band].keys())}") print(f"invoking restore_link_2 fib: {fib} , slots {slots} , band {band} ") self.restore_link_2(fib, slots, band) print(f"invoking restore_link fib: {fib} , slots {slots} , band {band} ") self.restore_link(fib, slots, band) self.optical_bands[o_b_id]["is_active"]=False if debug: Loading @@ -444,7 +426,7 @@ class RSA(): # fib = link['fibers'][f] fib = self.get_link_by_name(r_l)["optical_details"] if list_in_list(slots, str_list_to_int(fib[band].keys())): self.restore_link_2(fib, slots, band, link=l) self.restore_link(fib, slots, band) if debug: print(fib[band]) ''' Loading Loading @@ -509,8 +491,7 @@ class RSA(): continue if list_in_list(slots, str_list_to_int(fib[band].keys())): #fiber_list[l] = fib["ID"] #self.update_link(fib, slots, band) self.update_link_2(fib,slots,band) self.update_link(fib, slots, band) break print("INFO: Path forward computation completed") return fiber_list Loading Loading @@ -1232,5 +1213,4 @@ class RSA(): link = self.get_link_by_name(link_x) fib = link["optical_details"] self.update_link(fib, new_slots, band_type) return new_slots src/service/service/ServiceServiceServicerImpl.py +1 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): # reply with 2 transponders and 2 roadms reply_json = json.loads(reply_txt) LOGGER.warning('reply_json[{:s}]={:s}'.format(str(type(reply_json)), str(reply_json))) LOGGER.debug('[optical] reply_json[{:s}]={:s}'.format(str(type(reply_json)), str(reply_json))) optical_band_txt = "" if "new_optical_band" in reply_json.keys(): if reply_json["new_optical_band"] == 1: Loading Loading
src/opticalcontroller/RSA.py +9 −29 Original line number Diff line number Diff line Loading @@ -269,15 +269,6 @@ class RSA(): print(f"fib updated {fib}") #print(fib) def update_link_2(self, fib, slots, band): #print(fib) for i in slots: fib[band][str(i)] = 0 if 'used' in fib: fib['used'] = True def update_optical_band(self, optical_band_id, slots, band): for i in slots: self.optical_bands[optical_band_id][band][str(i)] = 0 Loading @@ -293,18 +284,9 @@ class RSA(): fib['used'] = False #fib[band].sort() def restore_link_2(self, fib, slots, band): for i in slots: fib[band][str(i)] = 1 if 'used' in fib: fib['used'] = False def restore_optical_band(self, optical_band_id, slots, band): for i in slots: self.optical_bands[optical_band_id][band][str(i)] = 1 #self.optical_bands[optical_band_id][band].append(int(i)) #self.optical_bands[optical_band_id][band].sort() Loading Loading @@ -366,7 +348,7 @@ class RSA(): # fib = link['fibers'][f] fib = self.get_link_by_name(r_l)["optical_details"] if list_in_list(slots, str_list_to_int(fib[band].keys())): self.restore_link_2(fib, slots, band, link=l) self.restore_link(fib, slots, band) if debug: print(fib[band]) ''' Loading @@ -379,7 +361,7 @@ class RSA(): #rfib = rlink['fibers'][rf] rfib = self.get_fiber_details(rl, fiber_b[rl]) if not list_in_list(slots, rfib[band]): self.restore_link_2(rfib, slots, band) self.restore_link(rfib, slots, band) if debug: print(rfib[band]) ''' Loading Loading @@ -420,8 +402,8 @@ class RSA(): print(f"del_flow_fib {fib } and band {band}") print(f"del_flow { str_list_to_int(fib[band].keys())}") print(f"invoking restore_link_2 fib: {fib} , slots {slots} , band {band} ") self.restore_link_2(fib, slots, band) print(f"invoking restore_link fib: {fib} , slots {slots} , band {band} ") self.restore_link(fib, slots, band) self.optical_bands[o_b_id]["is_active"]=False if debug: Loading @@ -444,7 +426,7 @@ class RSA(): # fib = link['fibers'][f] fib = self.get_link_by_name(r_l)["optical_details"] if list_in_list(slots, str_list_to_int(fib[band].keys())): self.restore_link_2(fib, slots, band, link=l) self.restore_link(fib, slots, band) if debug: print(fib[band]) ''' Loading Loading @@ -509,8 +491,7 @@ class RSA(): continue if list_in_list(slots, str_list_to_int(fib[band].keys())): #fiber_list[l] = fib["ID"] #self.update_link(fib, slots, band) self.update_link_2(fib,slots,band) self.update_link(fib, slots, band) break print("INFO: Path forward computation completed") return fiber_list Loading Loading @@ -1232,5 +1213,4 @@ class RSA(): link = self.get_link_by_name(link_x) fib = link["optical_details"] self.update_link(fib, new_slots, band_type) return new_slots
src/service/service/ServiceServiceServicerImpl.py +1 −1 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ class ServiceServiceServicerImpl(ServiceServiceServicer): # reply with 2 transponders and 2 roadms reply_json = json.loads(reply_txt) LOGGER.warning('reply_json[{:s}]={:s}'.format(str(type(reply_json)), str(reply_json))) LOGGER.debug('[optical] reply_json[{:s}]={:s}'.format(str(type(reply_json)), str(reply_json))) optical_band_txt = "" if "new_optical_band" in reply_json.keys(): if reply_json["new_optical_band"] == 1: Loading