mirror of https://git.48k.eu/ogclient
Fix /hardware command Linux operation
This patch runs the script InventarioHardware with the right arguments.more_events
parent
434bb272b5
commit
96c2ddea2d
|
@ -84,7 +84,10 @@ def software(request, path, ogRest):
|
|||
|
||||
def hardware(path, ogRest):
|
||||
try:
|
||||
ogRest.proc = subprocess.Popen([OG_PATH + 'interfaceAdm/InventarioHardware', path], stdout=subprocess.PIPE, shell=True)
|
||||
cmd = [OG_PATH + 'interfaceAdm/InventarioHardware ' + path]
|
||||
ogRest.proc = subprocess.Popen(cmd,
|
||||
stdout=subprocess.PIPE,
|
||||
shell=True)
|
||||
(output, error) = ogRest.proc.communicate()
|
||||
except:
|
||||
raise ValueError('Error: Incorrect command value')
|
||||
|
|
|
@ -131,9 +131,9 @@ class ogThread():
|
|||
|
||||
jsonResp = jsonResponse()
|
||||
f = open(path, "r")
|
||||
lines = f.readlines()
|
||||
text = f.read()
|
||||
f.close()
|
||||
jsonResp.addElement('hardware', lines[0])
|
||||
jsonResp.addElement('hardware', text)
|
||||
|
||||
response = restResponse(ogResponses.OK, jsonResp)
|
||||
client.send(response.get())
|
||||
|
|
Loading…
Reference in New Issue