From: Zhongyue Luo Date: Thu, 14 Jun 2012 07:19:14 +0000 (+0800) Subject: Remove unused functions in common/utils.py X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=0311490b82479ef1e0d25350a17fe7a254e7a1c2;p=openstack-build%2Fneutron-build.git Remove unused functions in common/utils.py Fixes bug #1013017 Delete functions int_from_bool_as_string and bool_from_string. Change-Id: I5e838c1659234b885429ac090db4aa49e2f90645 --- 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