mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Fix service status checking with custom command (#12)
This commit is contained in:
parent
ba61264331
commit
4f48d1fc10
1 changed files with 5 additions and 5 deletions
10
service.py
10
service.py
|
@ -200,14 +200,14 @@ def service_status(names=[]):
|
||||||
|
|
||||||
# Retrieve service status
|
# Retrieve service status
|
||||||
try:
|
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:
|
except subprocess.CalledProcessError as e:
|
||||||
if 'usage:' not in e.output.lower():
|
if 'usage:' in e.output.lower():
|
||||||
result[name]['status'] = 'inactive'
|
|
||||||
else:
|
|
||||||
# TODO: Log output?
|
|
||||||
msignals.display(m18n.n('service_status_failed', name),
|
msignals.display(m18n.n('service_status_failed', name),
|
||||||
'warning')
|
'warning')
|
||||||
|
else:
|
||||||
|
result[name]['status'] = 'inactive'
|
||||||
else:
|
else:
|
||||||
result[name]['status'] = 'running'
|
result[name]['status'] = 'running'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue