17
17
# You should have received a copy of the GNU Lesser General Public License
18
18
# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
21
23
def bool_from_string(value):
22
24
"""Interpret string value as boolean.
24
26
Returns True if value translates to True otherwise False.
29
31
msg = "Unable to interpret non-string value '%s' as boolean" % (value)
32
36
if value in ['y', 'yes', 'true', 't']:
34
38
elif value in ['n', 'no', 'false', 'f']: