WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 2/3] xenserver: Allow unknown other-config attributes.

To: dev@xxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 2/3] xenserver: Allow unknown other-config attributes.
From: Ethan Jackson <ethan@xxxxxxxxxx>
Date: Wed, 19 Jan 2011 11:58:15 -0800
Cc: Dominic Curran <Dominic.Curran@xxxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>, xen-api@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sat, 22 Jan 2011 07:54:31 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxx>
CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
CC: Dominic Curran <Dominic.Curran@xxxxxxxxxx>
---
 .../opt_xensource_libexec_InterfaceReconfigure.py  |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigure.py 
b/xenserver/opt_xensource_libexec_InterfaceReconfigure.py
index 48b3938..7204032 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 = {}
-- 
1.7.2


_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH 2/3] xenserver: Allow unknown other-config attributes., Ethan Jackson <=