summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/linux/ogOperations.py8
-rw-r--r--src/ogRest.py6
2 files changed, 10 insertions, 4 deletions
diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py
index 357dd2f..e58256f 100644
--- a/src/linux/ogOperations.py
+++ b/src/linux/ogOperations.py
@@ -75,7 +75,13 @@ def software(request, path, ogRest):
partition = request.getPartition()
try:
- ogRest.proc = subprocess.Popen([OG_PATH + 'interfaceAdm/InventarioSoftware', disk, partition, path], stdout=subprocess.PIPE, shell=True)
+ cmd = OG_PATH + 'interfaceAdm/InventarioSoftware '
+ cmd += str(disk) + ' '
+ cmd += str(partition) + ' '
+ cmd += path
+ ogRest.proc = subprocess.Popen([cmd],
+ stdout=subprocess.PIPE,
+ shell=True)
(output, error) = ogRest.proc.communicate()
except:
raise ValueError('Error: Incorrect command value')
diff --git a/src/ogRest.py b/src/ogRest.py
index f46a331..65a2731 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -114,9 +114,9 @@ class ogThread():
jsonResp.addElement('partition', request.getPartition())
f = open(path, "r")
- lines = f.readlines()
+ output = f.read()
f.close()
- jsonResp.addElement('software', lines[0])
+ jsonResp.addElement('software', output)
response = restResponse(ogResponses.OK, jsonResp)
client.send(response.get())
@@ -295,7 +295,7 @@ class ogRest():
threading.Thread(target=ogThread.session, args=(client, request, self,)).start()
def process_software(self, client, request):
- path = '/tmp/CSft-' + client.ip + '-' + request.getPartition()
+ path = '/tmp/CSft-' + client.ip + '-' + str(request.getPartition())
threading.Thread(target=ogThread.software, args=(client, request, path, self,)).start()
def process_hardware(self, client):