[fix] Empty arguments

This commit is contained in:
ljf 2018-10-07 13:02:34 +02:00
parent 8d9f902d4f
commit d930fa05d5
2 changed files with 3 additions and 1 deletions

View file

@ -593,7 +593,7 @@ class ActionsMap(object):
# * namespace define the top "name", for us it will always be # * namespace define the top "name", for us it will always be
# "yunohost" and there well be only this one # "yunohost" and there well be only this one
# * actionsmap is the actual actionsmap that we care about # * actionsmap is the actual actionsmap that we care about
for namespace, actionsmap in list(actionsmaps.items()): for namespace, actionsmap in actionsmaps.items():
# Retrieve global parameters # Retrieve global parameters
_global = actionsmap.pop('_global', {}) _global = actionsmap.pop('_global', {})

View file

@ -315,6 +315,8 @@ class ActionsMapParser(BaseActionsMapParser):
deprecated_alias=deprecated_alias) deprecated_alias=deprecated_alias)
def add_global_arguments(self, arguments): def add_global_arguments(self, arguments):
if not arguments:
return
for argument_name, argument_options in arguments.items(): for argument_name, argument_options in arguments.items():
# will adapt arguments name for cli or api context # will adapt arguments name for cli or api context
names = self.format_arg_names(str(argument_name), names = self.format_arg_names(str(argument_name),