mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
0103c5e512
commit
4586f27b6c
1 file changed
+6
-4
@@ -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:
|
||||
|
||||