We are using yes/no for some boolean values within the recipe. This
patch extends the bool_it function, so it can be used to handle the
conversions instead of any other approaches.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
lnst/Common/Utils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py
index b2315f8..c3acafb 100644
--- a/lnst/Common/Utils.py
+++ b/lnst/Common/Utils.py
@@ -85,9 +85,9 @@ def int_it(val):
def bool_it(val):
if isinstance(val, str):
- if re.match("^\s*(?i)(true)", val):
+ if re.match("^\s*(?i)(true)", val) or
re.match("^\s*(?i)(yes)", val):
return True
- elif re.match("^\s*(?i)(false)", val):
+ elif re.match("^\s*(?i)(false)", val) or
re.match("^\s*(?i)(no)", val):
return False
return True if int_it(val) else False
--
1.8.3.1