From: Tony Mack Date: Thu, 2 Apr 2009 17:36:05 +0000 (+0000) Subject: in set_pl_info, make usre booleans that are string typed are converted to real boolea... X-Git-Tag: sfa-0.9-0@14641~528 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7b91bd4f18be123689df31cb41bb713c2d040a3b;p=sfa.git in set_pl_info, make usre booleans that are string typed are converted to real boolean type --- diff --git a/geni/util/record.py b/geni/util/record.py index 80384d9f..589b9a3c 100644 --- a/geni/util/record.py +++ b/geni/util/record.py @@ -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