mirror of https://git.48k.eu/ogclient
(Clean-Up) Rename cmd function/variables to use "run" syntax
parent
51ad896dee
commit
8e54420dfd
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue