From: Jim Fehlig <jfehlig@novell.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATC][xend] Implement get_by_name_label for class XendNetwork
Date: Thu, 29 Nov 2007 16:07:57 -0700 [thread overview]
Message-ID: <474F464D.9050300@novell.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 193 bytes --]
Although XenAPI c-bindings support this operation on Network class,
there is no implementation in xend. This patch provides one.
Regards,
Jim
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
[-- Attachment #2: xend_network.patch --]
[-- Type: text/x-patch, Size: 1187 bytes --]
diff -r e10eacec8b91 tools/python/xen/xend/XendNetwork.py
--- a/tools/python/xen/xend/XendNetwork.py Wed Nov 28 22:36:33 2007 +0000
+++ b/tools/python/xen/xend/XendNetwork.py Thu Nov 29 15:27:46 2007 -0700
@@ -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)
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
reply other threads:[~2007-11-29 23:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=474F464D.9050300@novell.com \
--to=jfehlig@novell.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.