On Sun, Oct 18, 2009 at 1:39 PM, Jeremy Orem <
jerem...@gmail.com> wrote:
>
> On Oct 18, 1:33 pm, Alex Polvi <
po...@cloudkick.com> wrote:
>> Another option would be to just add special optional kwargs with the
>> (adminPass=None, etc) to the node. That way it would be explicit.
>> However, then it would be hard to actually make a consistent
>> interface.
>
> I'm mostly worried we'll keep tacking on more and more kwargs, but
> maybe something like admin password is common enough to add it in as
> an optional kwarg.
If we go with extra={}, do you think it would work like this?
def __init__(self, foo, bar, extra={}):
self.foo = foo
self.bar = bar
self.extra = extra
Then app code would go: adminpass = node.extra.get('adminPass', None)
Or would it be like this?
def __init__(self, foo, bar, extra={}):
self.foo = foo
self.bar = bar
self.adminpass = extra.get('adminPass', None)
Another option would be to add an "attributes" field, which has all
the data that came back from the provider. It would be up to the
to_node implementation to take all the extra data out of the providers
response and shove it in there. The advantage of this is that we would
never lose any data that came back from the provider. The downside is
that it would be a random grab bag of stuff.
-Alex
>
>> I think I'm leaning towards the extras={} kwarg, so that it is clear
>> that it is a libcloud convention...
>>
>> -Alex
> >
>