mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #1135 from YunoHost/fix-default-in-arg-parse
fix default arg parse for password
This commit is contained in:
commit
739d831cf9
2 changed files with 8 additions and 0 deletions
|
@ -2424,6 +2424,10 @@ class YunoHostArgumentFormatParser(object):
|
|||
if parsed_question.ask is None:
|
||||
parsed_question.ask = "Enter value for '%s':" % parsed_question.name
|
||||
|
||||
# Empty value is parsed as empty string
|
||||
if parsed_question.default == "":
|
||||
parsed_question.default = None
|
||||
|
||||
return parsed_question
|
||||
|
||||
def parse(self, question, user_answers):
|
||||
|
|
|
@ -260,6 +260,10 @@ def test_parse_args_in_yunohost_format_password_no_input_optional():
|
|||
|
||||
assert _parse_args_in_yunohost_format(answers, questions) == expected_result
|
||||
|
||||
questions = [{"name": "some_password", "type": "password", "optional": True, "default": ""}]
|
||||
|
||||
assert _parse_args_in_yunohost_format(answers, questions) == expected_result
|
||||
|
||||
|
||||
def test_parse_args_in_yunohost_format_password_optional_with_input():
|
||||
questions = [
|
||||
|
|
Loading…
Add table
Reference in a new issue