non mandatory api opt._name error
This commit is contained in:
parent
8795180867
commit
fb2aa0ed67
1 changed files with 1 additions and 7 deletions
|
@ -220,7 +220,7 @@ class Config(object):
|
||||||
def _is_empty(self, opt):
|
def _is_empty(self, opt):
|
||||||
if (not opt.is_multi() and self._cfgimpl_values[opt._name] == None) or \
|
if (not opt.is_multi() and self._cfgimpl_values[opt._name] == None) or \
|
||||||
(opt.is_multi() and (self._cfgimpl_values[opt._name] == [] or \
|
(opt.is_multi() and (self._cfgimpl_values[opt._name] == [] or \
|
||||||
None in self._cfgimpl_values[name])):
|
None in self._cfgimpl_values[opt._name])):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -284,12 +284,6 @@ class Config(object):
|
||||||
homeconfig = self._cfgimpl_get_toplevel()
|
homeconfig = self._cfgimpl_get_toplevel()
|
||||||
mandatory = homeconfig._cfgimpl_mandatory
|
mandatory = homeconfig._cfgimpl_mandatory
|
||||||
if opt_or_descr.is_mandatory() and mandatory:
|
if opt_or_descr.is_mandatory() and mandatory:
|
||||||
if name == 'ip_ssh_eth0':
|
|
||||||
print "c'est bien une mandataire2"
|
|
||||||
print self._cfgimpl_values[name]
|
|
||||||
print self._is_empty(opt_or_descr)
|
|
||||||
print type(opt_or_descr)
|
|
||||||
print opt_or_descr.is_empty_by_default()
|
|
||||||
if self._is_empty(opt_or_descr) and \
|
if self._is_empty(opt_or_descr) and \
|
||||||
opt_or_descr.is_empty_by_default():
|
opt_or_descr.is_empty_by_default():
|
||||||
raise MandatoryError("option: {0} is mandatory "
|
raise MandatoryError("option: {0} is mandatory "
|
||||||
|
|
Loading…
Reference in a new issue