Just use int(BOOL) to convert to 1 or 0

(This is split out from I24461f4328e188c8983ad574495e11e033ec5ba4 on
neutron, which was a hunt to remove "PRED and A or B" deprecated ternary
idiom.)

int(bool) already returns only 1 or 0 - no need to do our own explicit
version.

Change-Id: Ib482d6cb63ece7e1d5073fa7dc1c7daf9db8a0b3
This commit is contained in:
Angus Lees
2014-08-28 10:03:37 +10:00
parent 118f7ea84a
commit fc069d154b

View File

@@ -94,7 +94,7 @@ def int_from_bool_as_string(subject):
Useful for JSON-decoded stuff and config file parsing
"""
return bool_from_string(subject) and 1 or 0
return int(bool_from_string(subject))
def bool_from_string(subject, strict=False, default=False):