diff options
author | Alvaro Neira Ayuso <aneira@soleta.eu> | 2020-01-13 18:38:34 +0100 |
---|---|---|
committer | Alvaro Neira Ayuso <alvaroneay@gmail.com> | 2020-01-19 19:50:44 +0100 |
commit | 0f32b9ca88d0870e717549ffe14d9717a1b034e4 (patch) | |
tree | cdeed3c6df7c7c7c25f9befba1b089cc55aa37c7 /src/linux | |
parent | 2e342b50c88722fb5d9511a180486bc0fe231519 (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')
-rw-r--r-- | src/linux/ogOperations.py | 6 |
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): |