in set_pl_info, make usre booleans that are string typed are converted to real boolea...
authorTony Mack <tmack@cs.princeton.edu>
Thu, 2 Apr 2009 17:36:05 +0000 (17:36 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Thu, 2 Apr 2009 17:36:05 +0000 (17:36 +0000)
geni/util/record.py

index 80384d9..589b9a3 100644 (file)
@@ -108,6 +108,14 @@ class GeniRecord:
     def set_pl_info(self, pl_info):
         if isinstance(pl_info, list):
             pl_info = pl_info[0]
+        
+        # Convert any boolean strings to real bools
+        for key in pl_info:
+            if isinstance(pl_info[key], StringTypes):
+                if pl_info[key].lower() in ["true"]:
+                    pl_info[key] = True
+                elif pl_info[key].lower() in ["false"]:
+                    pl_info[key] = False   
         self.pl_info = pl_info
         self.dirty = True