<br><br><div class="gmail_quote">On Wed, Aug 1, 2012 at 9:08 AM, Monty Taylor <span dir="ltr"><<a href="mailto:mordred@inaugust.com" target="_blank">mordred@inaugust.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
<br>
On 08/01/2012 05:11 AM, Chmouel Boudjnah wrote:<br></div><div class="im">
> I have started an implementation example here :<br>
><br>
> <a href="https://github.com/chmouel/python-novaclient/commit/3e4b4d367071ec251355fd5a15367c9028e7acca" target="_blank">https://github.com/chmouel/python-novaclient/commit/3e4b4d367071ec251355fd5a15367c9028e7acca</a><br>

><br></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"></div>
What if we use pkg_resources entry points instead of a pure __import__?<br>
It would allow people to pretty easily distribute plugins ...<br></blockquote><div><br></div><div>... </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im"><br>
> and connect with :<br>
><br>
> from novaclient.v1_1 import client<br>
> cnx = client.Client("user", "password", "notneeded",<br>
>                     "<a href="https://lon.identity.api.rackspacecloud.com/v2.0" target="_blank">https://lon.identity.api.rackspacecloud.com/v2.0</a>",<br>
>                     auth_strategy="rackspace2_0")<br>
><br>
> it would properly auth to RACK2.0 cloud[1].<br>
<br>
</div>Not to beat a dead horse here, but it would be STELLAR for there to be a<br>
discovery mechanism for this. If the call to client.Client could make a<br>
standard call that would return something that would indicate an ID key<br>
by which they would call their auth strategy, and then our client lib<br>
could look through any installed plugins that exist for one matching<br>
that key, so that we could remove the need for me to know that rax cloud<br>
needs rax auth strategy at invocation time.<br></blockquote><div><br></div><div><div>I've been doing a lot with pkg_resources plugins in ceilometer, the unified CLI, and some projects not related to OpenStack. That led me to start thinking about plugin patterns a bit, especially for enabling or selecting plugins at runtime. The result was a plugin loader library that sits on top of pkg_resources called stevedore[1]. It might make this client integration easier. See especially EnabledExtensionManager [2] or NamedExtensionManager [3]. Of course, if this is a new pattern then I would be happy to have a new manager added to the library to handle it.</div>
<div><br></div><div>Doug</div><div><br></div><div>[1] <a href="http://stevedore.readthedocs.org/en/latest/index.html">http://stevedore.readthedocs.org/en/latest/index.html</a></div></div><div>[2] <a href="http://stevedore.readthedocs.org/en/latest/managers.html#enabledextensionmanager">http://stevedore.readthedocs.org/en/latest/managers.html#enabledextensionmanager</a></div>
<div>[3] <a href="http://stevedore.readthedocs.org/en/latest/managers.html#namedextensionmanager">http://stevedore.readthedocs.org/en/latest/managers.html#namedextensionmanager</a></div><div><br></div></div>