Loading src/context/service/database/OpticalConfig.py +4 −4 Original line number Diff line number Diff line Loading @@ -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], Loading @@ -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], Loading @@ -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], Loading Loading
src/context/service/database/OpticalConfig.py +4 −4 Original line number Diff line number Diff line Loading @@ -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], Loading @@ -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], Loading @@ -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], Loading