[enh] new command 'app change-label'

This commit is contained in:
Laurent Peuch 2018-01-10 16:30:20 +01:00
parent 84502a2e3c
commit 28450ce8c3
2 changed files with 24 additions and 0 deletions

View file

@ -647,6 +647,19 @@ app:
authenticate: all
authenticator: ldap-anonymous
### app_change_label()
change-label:
action_help: Change an application label
api: PUT /apps/<app>/label
configuration:
authenticate: all
authenticator: ldap-anonymous
arguments:
app:
help: the application id
new_label:
help: the new application label
### app_addaccess() TODO: Write help
addaccess:
action_help: Grant access right to users (everyone by default)

View file

@ -1320,6 +1320,17 @@ def app_ssowatconf(auth):
logger.success(m18n.n('ssowat_conf_generated'))
def app_change_label(auth, app, new_label):
installed = _is_installed(app)
if not installed:
raise MoulinetteError(errno.ENOPKG,
m18n.n('app_not_installed', app=app))
app_setting(app, "label", value=new_label)
app_ssowatconf(auth)
def _get_app_settings(app_id):
"""
Get settings of an installed app