From 0311490b82479ef1e0d25350a17fe7a254e7a1c2 Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Thu, 14 Jun 2012 15:19:14 +0800 Subject: [PATCH] Remove unused functions in common/utils.py Fixes bug #1013017 Delete functions int_from_bool_as_string and bool_from_string. Change-Id: I5e838c1659234b885429ac090db4aa49e2f90645 --- quantum/common/utils.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/quantum/common/utils.py b/quantum/common/utils.py index 931a82c41..a3493921d 100644 --- a/quantum/common/utils.py +++ b/quantum/common/utils.py @@ -39,37 +39,6 @@ TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" FLAGS = flags.FLAGS -def int_from_bool_as_string(subject): - """ - Interpret a string as a boolean and return either 1 or 0. - - Any string value in: - ('True', 'true', 'On', 'on', '1') - is interpreted as a boolean True. - - Useful for JSON-decoded stuff and config file parsing - """ - return bool_from_string(subject) and 1 or 0 - - -def bool_from_string(subject): - """ - Interpret a string as a boolean. - - Any string value in: - ('True', 'true', 'On', 'on', '1') - is interpreted as a boolean True. - - Useful for JSON-decoded stuff and config file parsing - """ - if isinstance(subject, bool): - return subject - elif isinstance(subject, basestring): - if subject.strip().lower() in ('true', 'on', '1'): - return True - return False - - def boolize(subject): """ Quak like a boolean -- 2.45.2