Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!285Resolve: "(CNIT) New SBI Driver based on OpenROADM for ROADMs"
......@@ -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],
......@@ -254,7 +254,7 @@ def set_opticalconfig(db_engine : Engine, request : OpticalConfig):
stmt = stmt.returning(RoadmTypeModel.roadm_uuid)
roadm_id = session.execute(stmt).fetchone()
if len(interfaces) >0 :
if len(interfaces) > 0:
stmt = insert(ORInterfaceModel).values(interfaces)
stmt = stmt.on_conflict_do_update(
index_elements=[ORInterfaceModel.interface_uuid],
......
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