fix issue of recurse_zones not being converted to bool properly

add bool_from_str util call
add test for bool_from_str
slight rework of min/max_count check
This commit is contained in:
Chris Behrens
2011-06-29 15:22:56 -07:00
parent 9f013506ff
commit bb12449048

View File

@@ -772,6 +772,17 @@ def is_uuid_like(val):
return (len(val) == 36) and (val.count('-') == 4)
def bool_from_str(val):
"""Convert a string representation of a bool into a bool value"""
if not val:
return False
try:
return True if int(val) else False
except ValueError:
return val.lower() == 'true'
class Bootstrapper(object):
"""Provides environment bootstrapping capabilities for entry points."""