From e5f6dee95d7559fafc0e768366b3ac773ac91a4f Mon Sep 17 00:00:00 2001 From: llg8212 Date: Wed, 22 Jan 2014 11:45:42 +0800 Subject: 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 --- glanceclient/common/utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'glanceclient/common/utils.py') 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 -- cgit v1.2.1