From 1e84edbd7f199b0c2b7e5d331e7cf2221dda7975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Fri, 16 May 2014 22:57:37 +0200 Subject: [PATCH] [fix] Correct ActionsMapParser and empty value in the api --- moulinette/interfaces/api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/moulinette/interfaces/api.py b/moulinette/interfaces/api.py index 81f3630d..917bcbc0 100644 --- a/moulinette/interfaces/api.py +++ b/moulinette/interfaces/api.py @@ -64,7 +64,9 @@ class _HTTPArgumentParser(object): elif isinstance(value, str): if option_string is not None: arg_strings.append(option_string) - arg_strings.append(value) + # TODO: Review this fix + if value: + arg_strings.append(value) else: arg_strings.append(value) @@ -79,6 +81,7 @@ class _HTTPArgumentParser(object): for dest, opt in self._optional.items(): if dest in args: arg_strings = append(arg_strings, args[dest], opt[0]) + return self._parser.parse_args(arg_strings, namespace) def _error(self, message): @@ -333,7 +336,7 @@ class ActionsMapParser(BaseActionsMapParser): ## Implement virtual properties - name = 'api' + interface = 'api' ## Implement virtual methods