Commit 3b4737b5 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Fixed CI/CD pipeline for OFC24:

- Corrected Context database logic
parent e5ff8af1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ def set_opticalconfig(db_engine : Engine, request : OpticalConfig):
                stmt = stmt.returning(TransponderTypeModel.transponder_uuid)
                transponder_id = session.execute(stmt).fetchone()

            if (len(channels) > 0):
            if len(channels) > 0:
                stmt = insert(OpticalChannelModel).values(channels)
                stmt = stmt.on_conflict_do_update(
                    index_elements=[OpticalChannelModel.channel_uuid],
@@ -223,7 +223,7 @@ def set_opticalconfig(db_engine : Engine, request : OpticalConfig):
                stmt = stmt.returning(RoadmTypeModel.roadm_uuid)
                roadm_id = session.execute(stmt).fetchone()

                LOGGER.warning('channels={:s}'.format(str(channels)))
            if len(channels) > 0:
                stmt = insert(ChannelModel).values(channels)
                stmt = stmt.on_conflict_do_update(
                    index_elements=[ChannelModel.channel_uuid],
@@ -243,7 +243,7 @@ def set_opticalconfig(db_engine : Engine, request : OpticalConfig):
                opticalChannel_id = session.execute(stmt).fetchone()
         
        if config_type == DeviceTypeEnum.OPEN_ROADM._value_:
            if (len(roadms)>0):
            if len(roadms) > 0:
                stmt = insert(RoadmTypeModel).values(roadms)
                stmt = stmt.on_conflict_do_update(
                    index_elements=[RoadmTypeModel.roadm_uuid],