We do something similar that works in python-glanceclient. https://github.com/openstack/python-glanceclient/blob/master/glanceclient/common/http.py#L43
On Tue, Aug 20, 2013 at 10:09 AM, Joshua Harlow <harlo...@yahoo-inc.com>wrote: > Ok, that’s good. > > I don't think the following though would work. Maybe something else is > needed? > > try: > import eventlet > eventlet_on = True > except ImportError: > eventlet_on = False > > 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). > > From: Ben Nemec <openst...@nemebean.com> > Reply-To: "openst...@nemebean.com" <openst...@nemebean.com>, OpenStack > Development Mailing List <openstack-dev@lists.openstack.org> > Date: Monday, August 19, 2013 9:41 PM > To: "openstack-dev@lists.openstack.org" <openstack-dev@lists.openstack.org > > > Subject: Re: [openstack-dev] [Glance] Replacing Glance DB code to Oslo DB > code. > > On 08/19/13 20:34, Joshua Harlow wrote: > > Just a related question, > > 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. > > Will there be some refactoring there to not require it (useful for > projects that are trying to move away from eventlet). > > > https://github.com/openstack/oslo-incubator/blob/master/openstack/common/db/sqlalchemy/session.py#L248 > > > 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. > > -Ben > > _______________________________________________ > OpenStack-dev mailing list > OpenStack-dev@lists.openstack.org > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > >
_______________________________________________ OpenStack-dev mailing list OpenStack-dev@lists.openstack.org http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev