From 8c3872ae46fd178da95011c4fe96cadf8716cb50 Mon Sep 17 00:00:00 2001 From: Heitor Matsui Date: Fri, 3 May 2024 10:09:35 -0300 Subject: [PATCH] Fix in_sync_controller endpoint A bug was introduced by commit [1] that affected the endpoint /v1/software/in_sync_controller. As a consequence, host-swact was impacted. This commit fixes the endpoint. [1] https://review.opendev.org/c/starlingx/update/+/916597 Test Plan PASS: curl the endpoint /v1/software/in_sync_controller PASS: host-swact successfully Story: 2010676 Task: 50032 Change-Id: I68376d1998687fa6b7f87c8f57834bc322af6600 Signed-off-by: Heitor Matsui --- software/software/api/controllers/v1/deploy.py | 5 ----- software/software/api/controllers/v1/software.py | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/software/software/api/controllers/v1/deploy.py b/software/software/api/controllers/v1/deploy.py index e1f204f1..e000e3b0 100644 --- a/software/software/api/controllers/v1/deploy.py +++ b/software/software/api/controllers/v1/deploy.py @@ -23,7 +23,6 @@ class DeployController(RestController): 'precheck': ['POST'], 'start': ['POST'], 'complete': ['POST'], - 'is_sync_controller': ['GET'], 'software_upgrade': ['GET'], } @@ -74,10 +73,6 @@ class DeployController(RestController): result = sc.software_deploy_show_api(from_release, to_release) return result - @expose(method='GET', template='json') - def in_sync_controller(self): - return sc.in_sync_controller_api() - @expose(method='GET', template='json') def software_upgrade(self): return sc.get_software_upgrade() diff --git a/software/software/api/controllers/v1/software.py b/software/software/api/controllers/v1/software.py index e37a5f59..048d7861 100644 --- a/software/software/api/controllers/v1/software.py +++ b/software/software/api/controllers/v1/software.py @@ -14,6 +14,10 @@ LOG = logging.getLogger('main_logger') class SoftwareAPIController(RestController): + _custom_actions = { + "in_sync_controller": ["GET"], + } + @expose(method='GET', template='json') def in_sync_controller(self): return sc.in_sync_controller_api()