From 4f48d1fc10dc7e95330b936b60b3e03fd9bd6f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Tue, 1 Jul 2014 14:59:28 +0200 Subject: [PATCH] [fix] Fix service status checking with custom command (#12) --- service.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/service.py b/service.py index d2f334e48..86a95933d 100644 --- a/service.py +++ b/service.py @@ -200,14 +200,14 @@ def service_status(names=[]): # Retrieve service status try: - ret = subprocess.check_output(status.split(), stderr=subprocess.STDOUT) + ret = subprocess.check_output(status, stderr=subprocess.STDOUT, + shell=True) except subprocess.CalledProcessError as e: - if 'usage:' not in e.output.lower(): - result[name]['status'] = 'inactive' - else: - # TODO: Log output? + if 'usage:' in e.output.lower(): msignals.display(m18n.n('service_status_failed', name), 'warning') + else: + result[name]['status'] = 'inactive' else: result[name]['status'] = 'running'