From de033e6f960b205a971dd931b30e3973b2c31cb6 Mon Sep 17 00:00:00 2001 From: sshathee Date: Fri, 6 Sep 2024 04:49:31 -0400 Subject: [PATCH] Add an external api for software sync This commit introduces an external api for software_sync function, so that it can be called after prestaging. This will help sync the /opt/software directory between controllers. TestPlan: PASS: verify software sync api replicates the changes in /opt/software directory on a duplex controller Story: 2010676 Task: 50977 Change-Id: I3fd4956b4c91015a8f1cfa578c726ba0a14cb8e1 Signed-off-by: sshathee --- software/software/api/controllers/v1/deploy.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/software/software/api/controllers/v1/deploy.py b/software/software/api/controllers/v1/deploy.py index 8fecdd68..86bba7ff 100644 --- a/software/software/api/controllers/v1/deploy.py +++ b/software/software/api/controllers/v1/deploy.py @@ -28,6 +28,7 @@ class DeployController(RestController): 'complete': ['POST'], 'delete': ['DELETE'], 'software_upgrade': ['GET'], + 'software_sync': ['POST'], } @expose(method='POST', template='json') @@ -106,3 +107,9 @@ class DeployController(RestController): @expose(method='GET', template='json') def software_upgrade(self): return sc.get_software_upgrade() + + @expose(method='POST', template='json') + def software_sync(self): + reload_release_data() + result = sc.software_sync() + return {"result" : result}