mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Propagate changes from moulinette/simplify-interface-init
This commit is contained in:
parent
96e115c609
commit
d8be90165c
1 changed files with 2 additions and 11 deletions
|
@ -3,13 +3,13 @@
|
|||
|
||||
import os
|
||||
import sys
|
||||
import glob
|
||||
|
||||
import moulinette
|
||||
from moulinette import m18n
|
||||
from moulinette.utils.log import configure_logging
|
||||
from moulinette.interfaces.cli import colorize, get_locale
|
||||
|
||||
|
||||
def is_installed():
|
||||
return os.path.isfile('/etc/yunohost/installed')
|
||||
|
||||
|
@ -23,11 +23,10 @@ def cli(debug, quiet, output_as, timeout, args, parser):
|
|||
check_command_is_valid_before_postinstall(args)
|
||||
|
||||
ret = moulinette.cli(
|
||||
['yunohost'] + extensions(),
|
||||
args,
|
||||
output_as=output_as,
|
||||
timeout=timeout,
|
||||
parser_kwargs={'top_parser': parser},
|
||||
top_parser=parser
|
||||
)
|
||||
sys.exit(ret)
|
||||
|
||||
|
@ -43,21 +42,13 @@ def api(debug, host, port):
|
|||
# postinstall already done ...
|
||||
|
||||
ret = moulinette.api(
|
||||
['yunohost'] + extensions(),
|
||||
host=host,
|
||||
port=port,
|
||||
routes={('GET', '/installed'): is_installed_api},
|
||||
use_websocket=True
|
||||
)
|
||||
sys.exit(ret)
|
||||
|
||||
|
||||
def extensions():
|
||||
# This is probably not used anywhere, but the actionsmap and code can be
|
||||
# extended by creating such files that contain bits of actionmap...
|
||||
return [f.split('/')[-1][:-4] for f in glob.glob("/usr/share/moulinette/actionsmap/ynh_*.yml")]
|
||||
|
||||
|
||||
def check_command_is_valid_before_postinstall(args):
|
||||
|
||||
allowed_if_not_postinstalled = ['tools postinstall',
|
||||
|
|
Loading…
Add table
Reference in a new issue