mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Add log path to service helper
This commit is contained in:
parent
2393c8ae2d
commit
dcdf7e44bc
2 changed files with 8 additions and 1 deletions
|
@ -349,6 +349,9 @@ app:
|
||||||
-s:
|
-s:
|
||||||
full: --status
|
full: --status
|
||||||
help: Custom status command
|
help: Custom status command
|
||||||
|
-l:
|
||||||
|
full: --log
|
||||||
|
help: Absolute path to log file to display
|
||||||
-r:
|
-r:
|
||||||
full: --remove
|
full: --remove
|
||||||
help: Remove service
|
help: Remove service
|
||||||
|
|
|
@ -581,13 +581,14 @@ def app_setting(app, key, value=None, delete=False):
|
||||||
yaml.safe_dump(app_settings, f, default_flow_style=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
|
Add or remove a YunoHost monitored service
|
||||||
|
|
||||||
Keyword argument:
|
Keyword argument:
|
||||||
service -- Service to add/remove
|
service -- Service to add/remove
|
||||||
status -- Custom status command
|
status -- Custom status command
|
||||||
|
log -- Absolute path to log file to display
|
||||||
remove -- Remove service
|
remove -- Remove service
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -608,6 +609,9 @@ def app_service(service, status=None, remove=False):
|
||||||
else:
|
else:
|
||||||
services[service] = { 'status': status }
|
services[service] = { 'status': status }
|
||||||
|
|
||||||
|
if log is not None:
|
||||||
|
services[service]['log'] = log
|
||||||
|
|
||||||
with open(service_file, 'w') as f:
|
with open(service_file, 'w') as f:
|
||||||
yaml.safe_dump(services, f, default_flow_style=False)
|
yaml.safe_dump(services, f, default_flow_style=False)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue