invirt.common: handle yaml's None with empty struct for good error message 0.0.18
authorGreg Price <price@mit.edu>
Mon, 29 Dec 2008 00:27:15 +0000 (19:27 -0500)
committerGreg Price <price@mit.edu>
Mon, 29 Dec 2008 00:27:15 +0000 (19:27 -0500)
svn path=/trunk/packages/invirt-base/; revision=1935

debian/changelog
python/invirt/common.py

index 4200a28..4a9598e 100644 (file)
@@ -4,6 +4,7 @@ invirt-base (0.0.18) unstable; urgency=low
   * config-init.sh: degrade to non-bash gracefully, document better
   * invirt.config: fix an error on empty config files
   * invirt.common: give clearer error message on missing config variable
   * config-init.sh: degrade to non-bash gracefully, document better
   * invirt.config: fix an error on empty config files
   * invirt.common: give clearer error message on missing config variable
+  * invirt.common: handle yaml's None with empty struct for good error message
 
  -- Greg Price <price@mit.edu>  Sun, 28 Dec 2008 19:18:51 -0500
 
 
  -- Greg Price <price@mit.edu>  Sun, 28 Dec 2008 19:18:51 -0500
 
index 85f37d6..a85d955 100644 (file)
@@ -39,6 +39,8 @@ def dicts2struct(x, prefix = None):
                       prefix)
     elif type(x) == list:
         return [dicts2struct(v, newprefix(i)) for i, v in enumerate(x)]
                       prefix)
     elif type(x) == list:
         return [dicts2struct(v, newprefix(i)) for i, v in enumerate(x)]
+    elif x is None:
+        return struct({}, prefix)
     else:
         return x
 
     else:
         return x