Skip to contentSkip to conversation

Fix the display of the __NULL_LABEL__

PATCH Syunsuke HAYASHI 2 participants 2 messages Nov 14, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I think the security.py was changed to acm.py.
http://xenbits.xensource.com/staging/xen-unstable.hg?rev=security.py

This patch fixes the problem.

The result is shown as follows.
--------When xen-api is not effective-------

# xm labels type=any
dom_BoincClient              <---- __NULL_LABEL__ is removed.
dom_Fun
dom_HomeBanking
dom_NetworkDomain
dom_StorageDomain
dom_SystemManagement
res_EthernetCard
res_GraphicsAdapter
res_HardDrive(hda)
res_ImageFile1
res_ImageFile2
res_LogicalDiskPartition1(hda1)
res_LogicalDiskPartition2(hda2)
res_ManagementResource
--------------------------------------------

Thanks

Syunsuke HAYASHI

Quoted 26 lines
Quoted 26 lines

No longer display the __NULL_LABEL__ on the list of labels.

Index: root/xen-unstable.hg/tools/python/xen/util/security.py
===================================================================

xen-unstable.hg/tools/python/xen/util/security.py +5 -0
@@ -608,6 +608,11 @@ def list_labels(policy_name, condition):
            label = line.split()[3]
            if label not in labels:
                labels.append(label)
+
+    f.close()
+    if '__NULL_LABEL__' in labels:
+        labels.remove('__NULL_LABEL__')
+
    return labels
 
 
Quoted 6 lines
Quoted 6 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

diff -r 0c2535407828 tools/python/xen/util/xsm/acm/acm.py
--- a/tools/python/xen/util/xsm/acm/acm.py Mon Oct 08 09:40:49 2007
+0100
+++ b/tools/python/xen/util/xsm/acm/acm.py Wed Nov 14 11:40:11 2007
+0900
@@ -600,4 +600,8 @@ def list_labels(policy_name, condition):
label = line.split()[3]
if label not in labels:
labels.append(label)
+ f.close()
+ if '__NULL_LABEL__' in labels:
+ labels.remove('__NULL_LABEL__')
+
return labels

tools/python/xen/util/xsm/acm/acm.py Wed Nov 14 11:40:11 2007 +0900 renamed from tools/python/xen/util/xsm/acm/acm.py Mon Oct 08 09:40:49 2007 +0100 +4 -0
diff -r 0c2535407828 tools/python/xen/util/xsm/acm/acm.py
@@ -600,4 +600,8 @@ def list_labels(policy_name, condition):
             label = line.split()[3]
             if label not in labels:
                 labels.append(label)
+    f.close()
+    if '__NULL_LABEL__' in labels:
+        labels.remove('__NULL_LABEL__')
+
     return labels

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

[email protected] wrote on 11/14/2007 12:25:01 AM:

Quoted 3 lines

Hi,

I think the security.py was changed to acm.py.

Right. I worked against a much older version. Another patch that I'll post later this week or next will fix it for real, though.

Stefan

Quoted 79 lines

http://xenbits.xensource.com/staging/xen-unstable.hg?rev=security.py

This patch fixes the problem.

The result is shown as follows.
--------When xen-api is not effective-------

# xm labels type=any
dom_BoincClient              <---- __NULL_LABEL__ is removed.
dom_Fun
dom_HomeBanking
dom_NetworkDomain
dom_StorageDomain
dom_SystemManagement
res_EthernetCard
res_GraphicsAdapter
res_HardDrive(hda)
res_ImageFile1
res_ImageFile2
res_LogicalDiskPartition1(hda1)
res_LogicalDiskPartition2(hda2)
res_ManagementResource
--------------------------------------------

Thanks

Syunsuke HAYASHI

Quoted 26 lines
Quoted 26 lines

No longer display the __NULL_LABEL__ on the list of labels.

Index: root/xen-unstable.hg/tools/python/xen/util/security.py
===================================================================

xen-unstable.hg/tools/python/xen/util/security.py +5 -0
@@ -608,6 +608,11 @@ def list_labels(policy_name, condition):
            label = line.split()[3]
            if label not in labels:
                labels.append(label)
+
+    f.close()
+    if '__NULL_LABEL__' in labels:
+        labels.remove('__NULL_LABEL__')
+
    return labels
 
 
Quoted 6 lines
Quoted 6 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

diff -r 0c2535407828 tools/python/xen/util/xsm/acm/acm.py
--- a/tools/python/xen/util/xsm/acm/acm.py Mon Oct 08 09:40:49 2007
+0100
+++ b/tools/python/xen/util/xsm/acm/acm.py Wed Nov 14 11:40:11 2007
+0900

tools/python/xen/util/xsm/acm/acm.py Wed Nov 14 11:40:11 2007 +0900 renamed from tools/python/xen/util/xsm/acm/acm.py Mon Oct 08 09:40:49 2007 +0100 +4 -0
@@ -600,4 +600,8 @@ def list_labels(policy_name, condition):
             label = line.split()[3]
             if label not in labels:
                 labels.append(label)
+    f.close()
+    if '__NULL_LABEL__' in labels:
+        labels.remove('__NULL_LABEL__')
+
     return labels
Quoted 2 lines

diff -r 0c2535407828 tools/python/xen/util/xsm/acm/acm.py
--- a/tools/python/xen/util/xsm/acm/acm.py Mon Oct 08 09:40:49 2007

+0100

Quoted 1 line

+++ b/tools/python/xen/util/xsm/acm/acm.py Wed Nov 14 11:40:11 2007

+0900

Quoted 11 lines
tools/python/xen/util/xsm/acm/acm.py Wed Nov 14 11:40:11 2007 +0900 renamed from tools/python/xen/util/xsm/acm/acm.py Mon Oct 08 09:40:49 2007 +0100 +4 -0
@@ -600,4 +600,8 @@ def list_labels(policy_name, condition):
             label = line.split()[3]
             if label not in labels:
                 labels.append(label)
+    f.close()
+    if '__NULL_LABEL__' in labels:
+        labels.remove('__NULL_LABEL__')
+
     return labels
Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel