From b562b266e557bcb8986105029be42c5317a5f81a Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sun, 28 Dec 2008 19:27:15 -0500 Subject: [PATCH] invirt.common: handle yaml's None with empty struct for good error message svn path=/trunk/packages/invirt-base/; revision=1935 --- debian/changelog | 1 + python/invirt/common.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4200a28..4a9598e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 + * invirt.common: handle yaml's None with empty struct for good error message -- Greg Price Sun, 28 Dec 2008 19:18:51 -0500 diff --git a/python/invirt/common.py b/python/invirt/common.py index 85f37d6..a85d955 100644 --- a/python/invirt/common.py +++ b/python/invirt/common.py @@ -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)] + elif x is None: + return struct({}, prefix) else: return x -- 1.7.9.5