<div dir="ltr">We do something similar that works in python-glanceclient.<div><br></div><div><a href="https://github.com/openstack/python-glanceclient/blob/master/glanceclient/common/http.py#L43">https://github.com/openstack/python-glanceclient/blob/master/glanceclient/common/http.py#L43</a><br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 20, 2013 at 10:09 AM, Joshua Harlow <span dir="ltr"><<a href="mailto:harlowja@yahoo-inc.com" target="_blank">harlowja@yahoo-inc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word">
<div>Ok, that’s good.</div>
<div><br>
</div>
<div>I don't think the following though would work. Maybe something else is needed?</div>
<div><br>
</div>
<div>
<div>try:</div>
<div> import eventlet</div>
<div> eventlet_on = True</div>
<div>except ImportError:</div>
<div> eventlet_on = False</div>
</div>
<div><br>
</div>
<div>Due to how oslo.db could be used the environment may actually have eventlet installed (say a server running keystone and nova-api at the same time). The first project (keystone) might not want to use eventlet (but it might be in the python module path,
while nova-api on the same box would want to use it). So we might need a more advanced configuration setting to make this tunable (and not depend on the python import statement to be that tunable setting).</div>
<div><br>
</div>
<span>
<div style="border-right:medium none;padding-right:0in;padding-left:0in;padding-top:3pt;text-align:left;font-size:11pt;border-bottom:medium none;font-family:Calibri;border-top:#b5c4df 1pt solid;padding-bottom:0in;border-left:medium none">
<span style="font-weight:bold">From: </span>Ben Nemec <<a href="mailto:openstack@nemebean.com" target="_blank">openstack@nemebean.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>"<a href="mailto:openstack@nemebean.com" target="_blank">openstack@nemebean.com</a>" <<a href="mailto:openstack@nemebean.com" target="_blank">openstack@nemebean.com</a>>, OpenStack Development Mailing List <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Date: </span>Monday, August 19, 2013 9:41 PM<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>" <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [openstack-dev] [Glance] Replacing Glance DB code to Oslo DB code.<br>
</div>
<div><br>
</div>
<div>
<div>
<p>On 08/19/13 20:34, Joshua Harlow wrote:</p>
<blockquote>
<div>Just a related question,</div>
<div> </div>
<div>Oslo 'incubator' db code I think depends on eventlet. This means any code that uses the oslo.db code could/would(?) be dependent on eventlet.</div>
<div> </div>
<div>Will there be some refactoring there to not require it (useful for projects that are trying to move away from eventlet).</div>
<div> </div>
<div><a href="https://github.com/openstack/oslo-incubator/blob/master/openstack/common/db/sqlalchemy/session.py#L248" target="_blank">https://github.com/openstack/oslo-incubator/blob/master/openstack/common/db/sqlalchemy/session.py#L248</a></div>
<div> </div>
</blockquote>
<p>Glancing through that file, it looks like the greenthread import is only used for playing nice with other greenthreads. It should be pretty easy to make it conditional so we don't require it, but will use it if it's available.<br>
<br>
-Ben</p>
</div>
</div>
</span>
</div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>