Boolean options: use strict checking
Boolean options (such as "--protected" for glance md-namespace-update) should accept a limited amount of valid values, rather than assuming an "invalid" value means "False". The following values (no matter the case) will now be interpreted as True: ‘t’,’true’, ‘on’, ‘y’, ‘yes’, or ‘1’. The following values (no matter the case) will now be interpreted as False: ‘f’, ‘false’, ‘off’, ‘n’, ‘no’, or ‘0’. Change-Id: I0e7942045d883ac398bab4a7a85f2b4ac9b1ed8c Closes-Bug: #1607317
This commit is contained in:
@@ -103,7 +103,7 @@ def schema_args(schema_getter, omit=None):
|
||||
typemap = {
|
||||
'string': encodeutils.safe_decode,
|
||||
'integer': int,
|
||||
'boolean': strutils.bool_from_string,
|
||||
'boolean': lambda x: strutils.bool_from_string(x, strict=True),
|
||||
'array': list
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user