From 866066c97a06570525f64281eecc9d3aa6c36032 Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Fri, 18 Oct 2024 11:40:17 -0400 Subject: [PATCH 1/2] Do not duplicate service_id when listing connections --- sdx_controller/controllers/l2vpn_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdx_controller/controllers/l2vpn_controller.py b/sdx_controller/controllers/l2vpn_controller.py index ac9ff30..f679e5f 100644 --- a/sdx_controller/controllers/l2vpn_controller.py +++ b/sdx_controller/controllers/l2vpn_controller.py @@ -101,7 +101,7 @@ def get_connections(): # noqa: E501 return_values = {} for connection in values: service_id = next(iter(connection)) - return_values[service_id] = get_connection_status(db_instance, service_id) + return_values[service_id] = get_connection_status(db_instance, service_id)[service_id] return return_values From eee83461e7e75a6672bd07cdf9ae8dd173922db7 Mon Sep 17 00:00:00 2001 From: Cong Wang Date: Fri, 18 Oct 2024 11:43:56 -0400 Subject: [PATCH 2/2] Format --- sdx_controller/controllers/l2vpn_controller.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdx_controller/controllers/l2vpn_controller.py b/sdx_controller/controllers/l2vpn_controller.py index f679e5f..dfefc9b 100644 --- a/sdx_controller/controllers/l2vpn_controller.py +++ b/sdx_controller/controllers/l2vpn_controller.py @@ -101,7 +101,9 @@ def get_connections(): # noqa: E501 return_values = {} for connection in values: service_id = next(iter(connection)) - return_values[service_id] = get_connection_status(db_instance, service_id)[service_id] + return_values[service_id] = get_connection_status(db_instance, service_id)[ + service_id + ] return return_values