[PATCH 3/5] Raise exception instead of returning None

James Laska jlaska at redhat.com
Tue Dec 13 16:11:47 UTC 2011


---
 oz/ozutil.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/oz/ozutil.py b/oz/ozutil.py
index 40932c0..727d7d2 100644
--- a/oz/ozutil.py
+++ b/oz/ozutil.py
@@ -265,9 +265,10 @@ def string_to_bool(instr):
     lower = instr.lower()
     if lower == 'no' or lower == 'false':
         return False
-    if lower == 'yes' or lower == 'true':
+    elif lower == 'yes' or lower == 'true':
         return True
-    return None
+    else:
+        raise Exception, "Unhandled input string: %s" % instr
 
 def generate_macaddress():
     """
-- 
1.7.7.4




More information about the aeolus-devel mailing list