diff options
author | llg8212 <lilinguo@huawei.com> | 2014-01-22 11:45:42 +0800 |
---|---|---|
committer | llg8212 <lilinguo@huawei.com> | 2014-01-24 10:07:44 +0800 |
commit | e5f6dee95d7559fafc0e768366b3ac773ac91a4f (patch) | |
tree | a28222c516fef6bad2c7aa38ef52e18ad378d85e /glanceclient/common/utils.py | |
parent | e4d1961c926b425e93fa2d8bdd37e5c1f19d574b (diff) | |
download | python-glanceclient-e5f6dee95d7559fafc0e768366b3ac773ac91a4f.tar.gz |
Using common method 'bool_from_string' from oslo strutils
Using common method 'bool_from_string' from oslo strutils to replace
utils.string_to_bool.
partially implements blueprint common-client-library-2
Change-Id: I23924db3000feadcfe823c6cc979ea9752a13fa9
Diffstat (limited to 'glanceclient/common/utils.py')
-rw-r--r-- | glanceclient/common/utils.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/glanceclient/common/utils.py b/glanceclient/common/utils.py index 4aec25d..9d106c6 100644 --- a/glanceclient/common/utils.py +++ b/glanceclient/common/utils.py @@ -48,7 +48,7 @@ def schema_args(schema_getter, omit=[]): typemap = { 'string': str, 'integer': int, - 'boolean': string_to_bool, + 'boolean': strutils.bool_from_string, 'array': list } @@ -176,10 +176,6 @@ def is_authentication_required(f): return getattr(f, 'require_authentication', True) -def string_to_bool(arg): - return arg.strip().lower() in ('t', 'true', 'yes', '1') - - def env(*vars, **kwargs): """Search for the first defined of possibly many env vars |