mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge remote-tracking branch 'origin/unstable' into unstable
This commit is contained in:
commit
6f3dea276e
2 changed files with 11 additions and 4 deletions
|
@ -31,7 +31,7 @@
|
||||||
"app_manifest_invalid" : "Invalid app manifest",
|
"app_manifest_invalid" : "Invalid app manifest",
|
||||||
"app_argument_choice_invalid" : "Invalid choice for argument '{name:s}', it must be one of {choices:s}",
|
"app_argument_choice_invalid" : "Invalid choice for argument '{name:s}', it must be one of {choices:s}",
|
||||||
"app_argument_invalid" : "Invalid value for argument '{name:s}': {error:s}",
|
"app_argument_invalid" : "Invalid value for argument '{name:s}': {error:s}",
|
||||||
"app_argument_missing" : "Missing argument '{:s}'",
|
"app_argument_required" : "Argument '{name:s}' is required",
|
||||||
"app_sources_fetch_failed" : "Unable to fetch sources files",
|
"app_sources_fetch_failed" : "Unable to fetch sources files",
|
||||||
"ssowat_conf_updated" : "SSOwat persistent configuration successfully updated",
|
"ssowat_conf_updated" : "SSOwat persistent configuration successfully updated",
|
||||||
"ssowat_conf_generated" : "SSOwat configuration successfully generated",
|
"ssowat_conf_generated" : "SSOwat configuration successfully generated",
|
||||||
|
|
|
@ -1344,15 +1344,22 @@ def _parse_args_from_manifest(manifest, action, args={}, auth=None):
|
||||||
arg_value = input_string
|
arg_value = input_string
|
||||||
elif 'default' in arg:
|
elif 'default' in arg:
|
||||||
arg_value = arg['default']
|
arg_value = arg['default']
|
||||||
else:
|
|
||||||
raise MoulinetteError(errno.EINVAL,
|
|
||||||
m18n.n('app_argument_missing', name=arg_name))
|
|
||||||
|
|
||||||
# Validate argument value
|
# Validate argument value
|
||||||
|
if not arg_value and not arg.get('optional', False):
|
||||||
|
raise MoulinetteError(errno.EINVAL,
|
||||||
|
m18n.n('app_argument_required', name=arg_name))
|
||||||
|
elif not arg_value:
|
||||||
|
args_list.append('')
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Validate argument choice
|
||||||
if 'choices' in arg and arg_value not in arg['choices']:
|
if 'choices' in arg and arg_value not in arg['choices']:
|
||||||
raise MoulinetteError(errno.EINVAL,
|
raise MoulinetteError(errno.EINVAL,
|
||||||
m18n.n('app_argument_choice_invalid',
|
m18n.n('app_argument_choice_invalid',
|
||||||
name=arg_name, choices=', '.join(arg['choices'])))
|
name=arg_name, choices=', '.join(arg['choices'])))
|
||||||
|
|
||||||
|
# Validate argument type
|
||||||
# TODO: Add more type, e.g. boolean
|
# TODO: Add more type, e.g. boolean
|
||||||
arg_type = arg.get('type', 'string')
|
arg_type = arg.get('type', 'string')
|
||||||
if arg_type == 'domain':
|
if arg_type == 'domain':
|
||||||
|
|
Loading…
Add table
Reference in a new issue