From 8e54420dfd58f2c2178888b1deff0f791d670db2 Mon Sep 17 00:00:00 2001 From: Alvaro Neira Ayuso Date: Sat, 18 Jan 2020 13:57:48 +0100 Subject: (Clean-Up) Rename cmd function/variables to use "run" syntax --- src/HTTPParser.py | 8 ++++---- src/linux/ogOperations.py | 2 +- src/ogRest.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/HTTPParser.py b/src/HTTPParser.py index e0de594..29cbb42 100644 --- a/src/HTTPParser.py +++ b/src/HTTPParser.py @@ -20,7 +20,7 @@ class HTTPParser: self.contentLen = None self.operation = None self.URI = None - self.cmd = None + self.run = None self.partition = None self.disk = None self.cache = None @@ -61,7 +61,7 @@ class HTTPParser: return if "run" in cmd: - self.cmd = json_param["run"] + self.run = json_param["run"] try: self.echo = json_param["echo"] except: @@ -125,8 +125,8 @@ class HTTPParser: def getURI(self): return self.URI - def getCMD(self): - return self.cmd + def getrun(self): + return self.run def getDisk(self): return self.disk diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py index 119db4e..df78927 100644 --- a/src/linux/ogOperations.py +++ b/src/linux/ogOperations.py @@ -48,7 +48,7 @@ def reboot(): subprocess.call(['/sbin/reboot']) def execCMD(httpparser, ogRest): - cmd = httpparser.getCMD() + cmd = httpparser.getrun() cmds = cmd.split(" ") try: ogRest.proc = subprocess.Popen(cmds, stdout=subprocess.PIPE, shell=True) diff --git a/src/ogRest.py b/src/ogRest.py index 2e5c7a7..a4a7d6f 100644 --- a/src/ogRest.py +++ b/src/ogRest.py @@ -61,7 +61,7 @@ class restResponse(): class ogThread(): # Executing cmd thread def execcmd(client, httpparser, ogRest): - if httpparser.getCMD() == None: + if httpparser.getrun() == None: client.send(restResponse.getResponse(ogResponses.BAD_REQUEST)) return -- cgit v1.2.3-18-g5258