]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove unused functions in common/utils.py
authorZhongyue Luo <lzyeval@gmail.com>
Thu, 14 Jun 2012 07:19:14 +0000 (15:19 +0800)
committerZhongyue Luo <lzyeval@gmail.com>
Thu, 14 Jun 2012 07:19:14 +0000 (15:19 +0800)
Fixes bug #1013017

Delete functions int_from_bool_as_string and bool_from_string.

Change-Id: I5e838c1659234b885429ac090db4aa49e2f90645

quantum/common/utils.py

index 931a82c41ba69648c18854fd47f9b045f1085670..a3493921df54a493920a3197a588ca01c4b1774c 100644 (file)
@@ -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