summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-01-21 13:06:56 +0100
committerAlvaro Neira Ayuso <aneira@soleta.eu>2020-01-21 17:33:05 +0100
commitdabc7ebf83605dd6105599d7a45045e614e431cc (patch)
tree38ab5cef79602ef57af0436c1f381e22cf270c89 /src
parentca0a62f9c69e13e0c74b099de85f52a9daf0df54 (diff)
Change POST /refresh to GET /refresh
This patch changes the HTTP method for /refresh and cleans up the implementation of the /refresh Linux operator.
Diffstat (limited to 'src')
-rw-r--r--src/linux/ogOperations.py8
-rw-r--r--src/ogRest.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py
index e58256f..e41bb86 100644
--- a/src/linux/ogOperations.py
+++ b/src/linux/ogOperations.py
@@ -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')
diff --git a/src/ogRest.py b/src/ogRest.py
index 65a2731..d4521b8 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -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())