Driver specific attributes on Node?

1 view
Skip to first unread message

Soren Hansen

unread,
Nov 24, 2009, 7:48:25 AM11/24/09
to libc...@googlegroups.com
Just like we sometimes want to pass driver specific values to
create_node, it's sometimes useful to be able to return driver specific
information as a response to create_node (or list_nodes for that
matter)[1].

I can think of a number of ways to achieve this:

1. Add a dict called 'extra' as an attribute to the Node class. Any
driver specific information could be put there.

2. Allow Node objects to have extra attributes set. Two approaches to
this:

2a. Have Node.__init__ set any extra keyword arguments as attributes on
the Node object.

2b. Leave it up to the drivers to "manually" add attributes to the Node
objects.

3. Allow the drivers to subclass Node adding whatever extra
functionality they need.

I /think/ someone (I forget who) on IRC suggested option 1 a while ago.
However, I think option 2, implemented by 2a, most closely matches the
approach taken for create_node and thus feels most natural.

[1]: As an example, the Rackspace API returns an adminPass attribute
containing the root password in response to the "create_node" call.
There's no other way to get your hands on this information.

--
Soren Hansen |
Lead virtualisation engineer | Ubuntu Server Team
Canonical Ltd. | http://www.ubuntu.com/

signature.asc

Jeremy Orem

unread,
Nov 24, 2009, 11:34:55 AM11/24/09
to libcloud
This was implemented a couple weeks ago. Take a look at
http://github.com/cloudkick/libcloud/blob/master/libcloud/base.py#L20

-Jeremy
>  signature.asc
> < 1KViewDownload

Soren Hansen

unread,
Nov 24, 2009, 3:11:27 PM11/24/09
to libc...@googlegroups.com
On Tue, Nov 24, 2009 at 08:34:55AM -0800, Jeremy Orem wrote:
> This was implemented a couple weeks ago. Take a look at
> http://github.com/cloudkick/libcloud/blob/master/libcloud/base.py#L20

My word.. Well, that's what you get if you're looking at a stale, old
git snapshot. :)

Thanks!

signature.asc
Reply all
Reply to author
Forward
0 new messages