added check for all blank option values
This commit is contained in:
parent
b82c94efd8
commit
f675b0a16d
1 changed files with 3 additions and 2 deletions
|
@ -76,7 +76,7 @@ class ConfigurableManager(object):
|
||||||
try:
|
try:
|
||||||
# key=value
|
# key=value
|
||||||
(key, value) = kv.split('=', 1)
|
(key, value) = kv.split('=', 1)
|
||||||
if value is not None and value.is_empty():
|
if value is not None and not value.strip():
|
||||||
value = None
|
value = None
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# value only
|
# value only
|
||||||
|
@ -84,7 +84,8 @@ class ConfigurableManager(object):
|
||||||
value = kv
|
value = kv
|
||||||
if key not in keys:
|
if key not in keys:
|
||||||
raise ValueError, "invalid key: %s" % key
|
raise ValueError, "invalid key: %s" % key
|
||||||
setattr(target, key, value)
|
if value is not None:
|
||||||
|
setattr(target, key, value)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
|
|
Loading…
Reference in a new issue