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 <shunmugam.shatheesh@windriver.com>
This commit is contained in:
sshathee
2024-09-06 04:49:31 -04:00
parent f23e5cf445
commit de033e6f96

View File

@@ -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}