xenserver: Allow unknown other-config attributes.
authorEthan Jackson <ethan@nicira.com>
Mon, 17 Jan 2011 19:31:46 +0000 (11:31 -0800)
committerEthan Jackson <ethan@nicira.com>
Tue, 18 Jan 2011 22:57:08 +0000 (14:57 -0800)
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 <ethan@nicira.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Dominic Curran <Dominic.Curran@citrix.com>
xenserver/opt_xensource_libexec_InterfaceReconfigure.py

index 48b39389a62eb1d11748f8ad0bcda96d28297353..7204032c0419d3692722f87d78e19f5b18529f32 100644 (file)
@@ -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 = {}