ia64/xen-unstable

changeset 17381:522f64fbb8bf

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@us.ibm.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 03 11:33:10 2008 +0100 (2008-04-03)
parents 9a4c6b6a801d
children a2903704c17a
files tools/python/xen/util/xsm/acm/acm.py
line diff
     1.1 --- a/tools/python/xen/util/xsm/acm/acm.py	Thu Apr 03 11:32:20 2008 +0100
     1.2 +++ b/tools/python/xen/util/xsm/acm/acm.py	Thu Apr 03 11:33:10 2008 +0100
     1.3 @@ -1146,11 +1146,13 @@ def __resources_compatible_with_vmlabel(
     1.4      for key, value in resources.items():
     1.5          if key in [ 'vbd', 'tap' ]:
     1.6              for res in resources[key]:
     1.7 -                try:
     1.8 +                if not res in access_control:
     1.9 +                    label = [xsconstants.ACM_POLICY_ID,
    1.10 +                             xspol.get_name(),
    1.11 +                             ACM_LABEL_UNLABELED]
    1.12 +                else:
    1.13                      label = access_control[res]
    1.14 -                    if not collect_labels(reslabels, label, polname):
    1.15 -                        return False
    1.16 -                except:
    1.17 +                if not collect_labels(reslabels, label, polname):
    1.18                      return False
    1.19          elif key in [ 'vif' ]:
    1.20              for xapi_label in value: