Merge pull request #417 from YunoHost/rename_app

[enh] new command 'app change-label'
This commit is contained in:
Laurent Peuch 2018-01-14 00:27:25 +01:00 committed by GitHub
commit ee65c7c461
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 app label
api: PUT /apps/<app>/label
configuration:
authenticate: all
authenticator: ldap-anonymous
arguments:
app:
help: App ID
new_label:
help: New app 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