Add log path to service helper

This commit is contained in:
Kload 2013-12-05 15:59:19 +00:00
parent 2393c8ae2d
commit dcdf7e44bc
2 changed files with 8 additions and 1 deletions

View file

@ -349,6 +349,9 @@ app:
-s:
full: --status
help: Custom status command
-l:
full: --log
help: Absolute path to log file to display
-r:
full: --remove
help: Remove service

View file

@ -581,13 +581,14 @@ def app_setting(app, key, value=None, delete=False):
yaml.safe_dump(app_settings, f, default_flow_style=False)
def app_service(service, status=None, remove=False):
def app_service(service, status=None, log=None, remove=False):
"""
Add or remove a YunoHost monitored service
Keyword argument:
service -- Service to add/remove
status -- Custom status command
log -- Absolute path to log file to display
remove -- Remove service
"""
@ -608,6 +609,9 @@ def app_service(service, status=None, remove=False):
else:
services[service] = { 'status': status }
if log is not None:
services[service]['log'] = log
with open(service_file, 'w') as f:
yaml.safe_dump(services, f, default_flow_style=False)