Reviewed-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
On 03/25/2014 11:21 AM, Leonardo Garcia wrote:
From: Leonardo Garcia <lagarcia(a)br.ibm.com>
Instead of doing two comparisons, make just one and make this check
faster.
Signed-off-by: Leonardo Garcia <lagarcia(a)br.ibm.com>
---
src/kimchi/model/debugreports.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py
index 6ae282a..479d936 100644
--- a/src/kimchi/model/debugreports.py
+++ b/src/kimchi/model/debugreports.py
@@ -68,10 +68,7 @@ class DebugReportsModel(object):
command = ['sosreport', '--batch', '--name=%s' %
name]
output, error, retcode = run_command(command)
- if retcode < 0:
- raise OperationFailed("KCHDR0003E", {'name': name,
- 'err': retcode})
- elif retcode > 0:
+ if retcode != 0:
raise OperationFailed("KCHDR0003E", {'name': name,
'err': retcode})