summaryrefslogtreecommitdiffstats
path: root/src/linux/ogOperations.py
diff options
context:
space:
mode:
authorAlvaro Neira Ayuso <aneira@soleta.eu>2020-01-13 18:38:34 +0100
committerAlvaro Neira Ayuso <alvaroneay@gmail.com>2020-01-19 19:50:44 +0100
commit0f32b9ca88d0870e717549ffe14d9717a1b034e4 (patch)
treecdeed3c6df7c7c7c25f9befba1b089cc55aa37c7 /src/linux/ogOperations.py
parent2e342b50c88722fb5d9511a180486bc0fe231519 (diff)
Catch execution errors during init session command
This patch allows us to catch an exception when something wrong is happening executing the init session command. In error cases, ogClient sends an internal error http message to the server. Otherwise, an OK http message.
Diffstat (limited to 'src/linux/ogOperations.py')
-rw-r--r--src/linux/ogOperations.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py
index 5c136fa..e3dea5a 100644
--- a/src/linux/ogOperations.py
+++ b/src/linux/ogOperations.py
@@ -29,7 +29,11 @@ def procsession(httpparser):
disk = httpparser.getDisk()
partition = httpparser.getPartition()
- result = subprocess.check_output([OG_PATH + 'interfaceAdm/IniciarSesion', disk, partition], shell=True)
+ try:
+ result = subprocess.check_output([OG_PATH + 'interfaceAdm/IniciarSesion', disk, partition], shell=True)
+ except:
+ raise ValueError('Error: Incorrect command value')
+
return result.decode('utf-8')
def procsoftware(httpparser, path):