Skip to content
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"pika >= 1.2.0",
"dataset",
"pymongo > 3.0",
"sdx-pce @ git+https://github.com/atlanticwave-sdx/pce@v3.2.1",
"sdx-pce @ git+https://github.com/atlanticwave-sdx/pce@302-port-nni-removed",
]

[project.optional-dependencies]
Expand Down
21 changes: 17 additions & 4 deletions sdx_controller/handlers/connection_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,9 @@ def handle_link_failure(self, te_manager, failed_links):
connection["status"] = str(
ConnectionStateMachine.State.ERROR
)
else:
elif connection.get("status") == str(
ConnectionStateMachine.State.UP
):
connection, _ = connection_state_machine(
connection, ConnectionStateMachine.State.ERROR
)
Expand All @@ -517,11 +519,20 @@ def handle_link_failure(self, te_manager, failed_links):
)
continue

logger.debug("Removed connection:")
logger.debug(connection)
logger.debug(f"Removed connection:{connection}")
if connection.get("status") != str(
ConnectionStateMachine.State.ERROR
):
logger.info(
f"Connection {service_id} is in {connection.get('status')} state after link failure, no recovery needed."
)

connection, _ = connection_state_machine(
connection, ConnectionStateMachine.State.RECOVERING
)
connection, _ = connection_state_machine(
connection, ConnectionStateMachine.State.UNDER_PROVISIONING
)
connection["oxp_success_count"] = 0
self.db_instance.add_key_value_pair_to_db(
MongoCollections.CONNECTIONS, service_id, connection
Expand Down Expand Up @@ -571,6 +582,8 @@ def handle_uni_ports_up_to_down(self, uni_ports_up_to_down):
if not connection:
logger.debug(f"Cannot find connection {service_id} in DB.")
continue

# special case on uni port status change, out of SM
logger.info(f"Updating connection {service_id} status to 'down'.")
connection["status"] = "DOWN"
self.db_instance.add_key_value_pair_to_db(
Expand Down Expand Up @@ -611,7 +624,7 @@ def handle_uni_ports_down_to_up(self, uni_ports_down_to_up):
if not connection:
logger.debug(f"Cannot find connection {service_id} in DB.")
continue

# special case on uni port status change, out of SM
logger.info(f"Updating connection {service_id} status to 'up'.")
connection["status"] = "UP"
self.db_instance.add_key_value_pair_to_db(
Expand Down
25 changes: 17 additions & 8 deletions sdx_controller/handlers/lc_message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,26 @@ def process_lc_json_msg(

if oxp_response_code // 100 == 2:
if msg_json.get("operation") != "delete":
if connection.get("status") and (
connection.get("status")
!= str(ConnectionStateMachine.State.UNDER_PROVISIONING)
):
logger.info(
"Ignore oxp_conn_response, Connection is not under provisioning: "
+ service_id
)
return
oxp_success_count += 1
connection["oxp_success_count"] = oxp_success_count
if oxp_success_count == oxp_number:
if connection.get("status") and (
connection.get("status")
== str(ConnectionStateMachine.State.RECOVERING)
):
connection, _ = connection_state_machine(
connection,
ConnectionStateMachine.State.UNDER_PROVISIONING,
)
# if connection.get("status") and (
# connection.get("status")
# == str(ConnectionStateMachine.State.RECOVERING)
# ):
# connection, _ = connection_state_machine(
# connection,
# ConnectionStateMachine.State.UNDER_PROVISIONING,
# )
connection, _ = connection_state_machine(
connection, ConnectionStateMachine.State.UP
)
Expand Down
Loading