summaryrefslogtreecommitdiffstats
path: root/src/HTTPParser.py
diff options
context:
space:
mode:
authorAlvaro Neira Ayuso <aneira@soleta.eu>2020-01-02 19:48:14 +0100
committerAlvaro Neira Ayuso <alvaroneay@gmail.com>2020-01-19 19:50:44 +0100
commit2fa8aa4ff7deaf92c5b69be0c69fee95ce18ac37 (patch)
tree9c82dcd20ce3ddda5b8a1ba0e7edcbd9e91cba4e /src/HTTPParser.py
parentf566579f8e79eee8e51bab70eae91d705f2f2d00 (diff)
Add session command to init the opengnsys session
ogAdmClient has a support for initializing the session in the machine. This new command allows the new ogClient to execute the same script to init the session. The arguments will be received from the server as a json message. Format: { "disk" : "0", "partition" : "1"}
Diffstat (limited to 'src/HTTPParser.py')
-rw-r--r--src/HTTPParser.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/HTTPParser.py b/src/HTTPParser.py
index 912a7cf..1a3d7be 100644
--- a/src/HTTPParser.py
+++ b/src/HTTPParser.py
@@ -13,6 +13,8 @@ class HTTPParser:
self.operation = None
self.URI = None
self.cmd = None
+ self.partition = None
+ self.disk = None
def parser(self,data):
self.requestLine, self.headersAlone = data.split('\n', 1)
@@ -43,6 +45,12 @@ class HTTPParser:
if "run" in cmd:
self.cmd = jsoncmd["run"]
+ if "disk" in cmd:
+ self.disk = jsoncmd["disk"]
+
+ if "partition" in cmd:
+ self.partition = jsoncmd["partition"]
+
def getHeaderLine(self):
return self.headersAlone
@@ -69,3 +77,9 @@ class HTTPParser:
def getCMD(self):
return self.cmd
+
+ def getDisk(self):
+ return self.disk
+
+ def getPartition(self):
+ return self.partition