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
|
||||
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'
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue