Commit b1326b64 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Optical Controller component:

- Add error handling for unavailable optical spectrum in lightpath reservation
parent 204384c4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -83,6 +83,8 @@ class AddLightpath(Resource):
                LOGGER.warning("Invalid optical spectrum reservation: %s", str(exc))
                return str(exc), 400
            if rsa.db_flows[flow_id]["op-mode"] == 0:
                if reservation is not None:
                    return 'Requested optical spectrum is unavailable', 409
                return 'No path found', 404
            t1 = time.time() * 1000.0
            elapsed = t1 - t0
+3 −3
Original line number Diff line number Diff line
@@ -937,13 +937,13 @@ class RSA():
            flow_list, band_range, slots, fiber_f, fiber_b = self.select_slots_and_ports(
                links, num_slots, c_slots, l_slots, s_slots, bidir, reservation=reservation
            )
            if flow_list is None:
                self.null_values(self.flow_id)
                return self.flow_id
            f0, band = frequency_converter(band_range, slots)
            if debug:
                print(f0, band)
            print("INFO: RSA completed for normal wavelenght connection")
            if flow_list is None:
                self.null_values(self.flow_id)
                return self.flow_id
            slots_i = []
            for i in slots:
                slots_i.append(int(i))