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-changelog

[Xen-changelog] [xen-unstable] xend, acm: Assign an unlabeled resource t

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend, acm: Assign an unlabeled resource the __UNLABELED__ label
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 08 Apr 2008 02:01:25 -0700
Delivery-date: Tue, 08 Apr 2008 02:04:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1207218790 -3600
# Node ID 522f64fbb8bf44bc8820c6c86dacc904d41a53cf
# Parent  9a4c6b6a801df53cd38ea0d8bf1b1fdb46e9a937
xend, acm: Assign an unlabeled resource the __UNLABELED__ label

Assign an unlabeled resource the __UNLABELED__ label rather than
failing the lookup in the dictionary and catching the exception.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>
---
 tools/python/xen/util/xsm/acm/acm.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -r 9a4c6b6a801d -r 522f64fbb8bf tools/python/xen/util/xsm/acm/acm.py
--- a/tools/python/xen/util/xsm/acm/acm.py      Thu Apr 03 11:32:20 2008 +0100
+++ b/tools/python/xen/util/xsm/acm/acm.py      Thu Apr 03 11:33:10 2008 +0100
@@ -1146,11 +1146,13 @@ def __resources_compatible_with_vmlabel(
     for key, value in resources.items():
         if key in [ 'vbd', 'tap' ]:
             for res in resources[key]:
-                try:
+                if not res in access_control:
+                    label = [xsconstants.ACM_POLICY_ID,
+                             xspol.get_name(),
+                             ACM_LABEL_UNLABELED]
+                else:
                     label = access_control[res]
-                    if not collect_labels(reslabels, label, polname):
-                        return False
-                except:
+                if not collect_labels(reslabels, label, polname):
                     return False
         elif key in [ 'vif' ]:
             for xapi_label in value:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend, acm: Assign an unlabeled resource the __UNLABELED__ label, Xen patchbot-unstable <=