From: Ethan Jackson Date: Mon, 17 Jan 2011 19:31:46 +0000 (-0800) Subject: xenserver: Allow unknown other-config attributes. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dfa61ca3dd40021bbcf9db66b8bb57f5efafb71;p=openvswitch xenserver: Allow unknown other-config attributes. When saving the database cache, InterfaceReconfigure can crash if unexpected attributes are in an object's other-config column. This commit causes it to skip that attribute and log a warning. Signed-off-by: Ethan Jackson CC: Ian Campbell CC: Dominic Curran --- diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigure.py b/xenserver/opt_xensource_libexec_InterfaceReconfigure.py index 48b39389..7204032c 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigure.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigure.py @@ -245,9 +245,10 @@ def _map_to_xml(xml, parent, tag, val, attrs): e = xml.createElement(tag) parent.appendChild(e) for n,v in val.items(): - if not n in attrs: - raise Error("Unknown other-config attribute: %s" % n) - _str_to_xml(xml, e, n, v) + if n in attrs: + _str_to_xml(xml, e, n, v) + else: + log("Unknown other-config attribute: %s" % n) def _map_from_xml(n, attrs): ret = {}