for a multi mandatory, allow [] with allow_empty_list attribut
This commit is contained in:
@ -99,7 +99,7 @@ class Base(StorageBase):
|
||||
def __init__(self, name, doc, default=None, default_multi=None,
|
||||
requires=None, multi=False, callback=None,
|
||||
callback_params=None, validator=None, validator_params=None,
|
||||
properties=None, warnings_only=False, extra=None):
|
||||
properties=None, warnings_only=False, extra=None, allow_empty_list=False):
|
||||
if not valid_name(name): # pragma: optional cover
|
||||
raise ValueError(_("invalid name: {0} for option").format(name))
|
||||
if requires is not None:
|
||||
@ -134,7 +134,7 @@ class Base(StorageBase):
|
||||
'requirement {0}'.format(
|
||||
list(set_forbidden_properties)))
|
||||
StorageBase.__init__(self, name, _multi, warnings_only, doc, extra,
|
||||
calc_properties, requires, properties)
|
||||
calc_properties, requires, properties, allow_empty_list)
|
||||
if multi is not False and default is None:
|
||||
default = []
|
||||
self.impl_validate(default)
|
||||
@ -905,7 +905,7 @@ class SymLinkOption(OnlyOption):
|
||||
'for symlink {0}').format(name))
|
||||
super(Base, self).__init__(name, undefined, undefined, undefined,
|
||||
undefined, undefined, undefined, undefined,
|
||||
opt)
|
||||
False, opt)
|
||||
self.commit()
|
||||
|
||||
def __getattr__(self, name, context=undefined):
|
||||
|
Reference in New Issue
Block a user