diff options
author | Alvaro Neira Ayuso <aneira@soleta.eu> | 2020-01-18 13:59:18 +0100 |
---|---|---|
committer | Alvaro Neira Ayuso <alvaroneay@gmail.com> | 2020-01-19 19:50:44 +0100 |
commit | 44a4662fef5bac67503820b850614ac203c19664 (patch) | |
tree | b01906bdf52b85edf22e7e1302da1afa190cf53a /src/HTTPParser.py | |
parent | 8e54420dfd58f2c2178888b1deff0f791d670db2 (diff) |
(Clean-Up) Rename cmd variable to body
Diffstat (limited to 'src/HTTPParser.py')
-rw-r--r-- | src/HTTPParser.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/HTTPParser.py b/src/HTTPParser.py index 29cbb42..2095e95 100644 --- a/src/HTTPParser.py +++ b/src/HTTPParser.py @@ -53,52 +53,52 @@ class HTTPParser: if not self.contentLen == 0: msgs = self.headersAlone.rstrip().split('\n') - cmd = msgs[len(msgs) - 1] + body = msgs[len(msgs) - 1] try: - json_param = json.loads(cmd) + json_param = json.loads(body) except ValueError as e: print ("Error: Json message incomplete") return - if "run" in cmd: + if "run" in body: self.run = json_param["run"] try: self.echo = json_param["echo"] except: pass - if "disk" in cmd: + if "disk" in body: self.disk = json_param["disk"] - if "partition" in cmd: - if not "partition_setup" in cmd: + if "partition" in body: + if not "partition_setup" in body: self.partition = json_param["partition"] - if "cache" in cmd: + if "cache" in body: self.cache = json_param["cache"] - if "cache_size" in cmd: + if "cache_size" in body: self.cache_size = json_param["cache_size"] - if "partition_setup" in cmd: + if "partition_setup" in body: self.partition_setup = json_param["partition_setup"] - if "name" in cmd: + if "name" in body: self.name = json_param["name"] - if "repository" in cmd: + if "repository" in body: self.repo = json_param["repository"] - if "type" in cmd: + if "type" in body: self.type = json_param["type"] - if "profile" in cmd: + if "profile" in body: self.profile = json_param["profile"] - if "id" in cmd: + if "id" in body: self.id = json_param["id"] - if "code" in cmd: + if "code" in body: self.code = json_param["code"] def getHeaderLine(self): |