diff options
author | Alvaro Neira Ayuso <aneira@soleta.eu> | 2020-01-17 19:32:20 +0100 |
---|---|---|
committer | Alvaro Neira Ayuso <alvaroneay@gmail.com> | 2020-01-19 19:50:44 +0100 |
commit | 5603a280ef042b9ec0993ffa79f289aa2b2a9980 (patch) | |
tree | 9ac9ea0ca8c4065c3c8dc3a23ae7a92f389e7759 /src/HTTPParser.py | |
parent | b5e182f7dd6e99b68de268e52cdc1395d82932ee (diff) |
Improve /image/create command response
With this new patch, the image/create command will create a response message
with more information for the server. The new format is:
{"disk" : "1", "partition" : "1", "code" : "1", "id" : "1", "name" : "test",
"repository" : "192.168.2.4", "software" : "xyz"}
"xyz" will be the output saved during the execution of InventarioSoftware in
a specific path.
Diffstat (limited to 'src/HTTPParser.py')
-rw-r--r-- | src/HTTPParser.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/HTTPParser.py b/src/HTTPParser.py index c3be006..50976c3 100644 --- a/src/HTTPParser.py +++ b/src/HTTPParser.py @@ -32,6 +32,7 @@ class HTTPParser: self.profile = None self.id = None self.echo = None + self.code = None def parser(self,data): self.requestLine, self.headersAlone = data.split('\n', 1) @@ -97,6 +98,9 @@ class HTTPParser: if "id" in cmd: self.id = jsoncmd["id"] + if "code" in cmd: + self.code = jsoncmd["code"] + def getHeaderLine(self): return self.headersAlone @@ -156,3 +160,6 @@ class HTTPParser: def getEcho(self): return self.echo + + def getCode(self): + return self.code |