WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Fix xm labels

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix xm labels
From: Syunsuke HAYASHI <syunsuke@xxxxxxxxxxxxxx>
Date: Mon, 05 Nov 2007 21:03:29 +0900
Delivery-date: Mon, 05 Nov 2007 04:04:24 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.5 (Windows/20070716)
Hi,

This patch fixes "xm labels type=any" command error.

When the command "xm labels type=any" was input, the label of the
resource was not displayed before.
So,I fixed it.

Thanks,

Signed-off-by: Syunsuke HAYASHI <syunsuke@xxxxxxxxxxxxxx>


diff -r b28ae5f00553 tools/python/xen/xm/labels.py
--- a/tools/python/xen/xm/labels.py     Tue Oct 23 09:26:43 2007 +0100
+++ b/tools/python/xen/xm/labels.py     Fri Oct 26 11:11:36 2007 +0900
@@ -98,11 +98,8 @@ def labels_xapi(policy, ptype):
             names1 = acmpol.policy_get_virtualmachinelabel_names()
         if ptype == 'res' or ptype == 'any':
             names2 = acmpol.policy_get_resourcelabel_names()
-        if len(names1) > 0:
-            names = set(names1)
-            names.union(names2)
-        else:
-            names = set(names2)
+        names = list(set(names1).union(names2))
+        names.sort()
         for n in names:
             print n
     elif int(policystate['type']) == 0:
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix xm labels, Syunsuke HAYASHI <=