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>
This commit is contained in:
Keir Fraser committed 2008-04-03 11:33:10 +01:00
1 parent 0103c5e512
commit 4586f27b6c
1 file changed
+6 -4
+6 -4
View File
@@ -1146,11 +1146,13 @@ def __resources_compatible_with_vmlabel(xspol, dominfo, 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:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.