[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xend, acm: Assign an unlabeled resource the __UNLABELED__ label



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.