Change POST /refresh to GET /refresh

This patch changes the HTTP method for /refresh and cleans up the implementation
of the /refresh Linux operator.
more_events
Roberto Hueso Gómez 2020-01-21 13:06:56 +01:00 committed by Alvaro Neira Ayuso
parent ca0a62f9c6
commit dabc7ebf83
2 changed files with 6 additions and 6 deletions

View File

@ -162,11 +162,11 @@ def image_create(path, request, ogRest):
return output.decode('utf-8')
def refresh(ogRest):
listConfigs = []
disk = -1;
try:
ogRest.proc = subprocess.Popen([OG_PATH + 'interfaceAdm/getConfiguration'], stdout=subprocess.PIPE, shell=True)
cmd = OG_PATH + 'interfaceAdm/getConfiguration'
ogRest.proc = subprocess.Popen([cmd],
stdout=subprocess.PIPE,
shell=True)
(output, error) = ogRest.proc.communicate()
except:
raise ValueError('Error: Incorrect command value')

View File

@ -232,6 +232,8 @@ class ogRest():
self.process_hardware(client)
elif ("run/schedule" in URI):
self.process_schedule(client)
elif "refresh" in URI:
self.process_refresh(client)
else:
response = restResponse(ogResponses.BAD_REQUEST)
client.send(response.get())
@ -256,8 +258,6 @@ class ogRest():
self.process_stop(client)
elif ("image/create" in URI):
self.process_imagecreate(client, request)
elif ("refresh" in URI):
self.process_refresh(client)
else:
response = restResponse(ogResponses.BAD_REQUEST)
client.send(response.get())