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-changelog

[Xen-changelog] [xen-unstable] xend: Implement get_by_name_label for cla

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Implement get_by_name_label for class XendNetwork
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 05 Dec 2007 05:40:15 -0800
Delivery-date: Wed, 05 Dec 2007 05:40:57 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1196764915 0
# Node ID d1e1db24bd5fb09b53fa4c2c5400fdc10a8393d3
# Parent  7bee812a03979e2b99ba7a6731de22eb24290e2c
xend: Implement get_by_name_label for class XendNetwork

Although XenAPI c-bindings support this operation on Network class,
there is no implementation in xend.  This patch provides one.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>
---
 tools/python/xen/xend/XendNetwork.py |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff -r 7bee812a0397 -r d1e1db24bd5f tools/python/xen/xend/XendNetwork.py
--- a/tools/python/xen/xend/XendNetwork.py      Tue Dec 04 10:40:48 2007 +0000
+++ b/tools/python/xen/xend/XendNetwork.py      Tue Dec 04 10:41:55 2007 +0000
@@ -65,7 +65,7 @@ class XendNetwork(XendBase):
         return XendBase.getMethods() + methods
 
     def getFuncs(self):
-        funcs = ['create']
+        funcs = ['create', 'get_by_name_label']
         return XendBase.getFuncs() + funcs
 
     getClass    = classmethod(getClass)
@@ -133,9 +133,15 @@ class XendNetwork(XendBase):
 
         return uuid
 
-    create_phy  = classmethod(create_phy)
-    recreate    = classmethod(recreate)
-    create      = classmethod(create)
+    def get_by_name_label(cls, name):
+        return [inst.get_uuid()
+                 for inst in XendAPIStore.get_all(cls.getClass())
+                 if inst.get_name_label() == name]
+    
+    create_phy        = classmethod(create_phy)
+    recreate          = classmethod(recreate)
+    create            = classmethod(create)
+    get_by_name_label = classmethod(get_by_name_label)
         
     def __init__(self, record, uuid):       
         XendBase.__init__(self, uuid, record)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: Implement get_by_name_label for class XendNetwork, Xen patchbot-unstable <=