Importing oslo_db.sqlalchemy and create_engine() issue

Bug #1493675 reported by Joshua Harlow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.db
Fix Released
Medium
Joshua Harlow

Bug Description

It appears the following may be happening due to invalid imports/order?

>>> from oslo_db.sqlalchemy import engines
>>> u = "sqlite:////tmp/test.db"
>>> engines.create_engine(u, connection_trace=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "oslo_db/sqlalchemy/engines.py", line 139, in create_engine
    connection_trace=connection_trace
  File "oslo_db/sqlalchemy/utils.py", line 913, in __call__
    self._url_from_target(target), target, arg, kw)
  File "oslo_db/sqlalchemy/utils.py", line 950, in _dispatch_on
    return self._dispatch_on_db_driver(dbname, driver, arg, kw)
  File "oslo_db/sqlalchemy/utils.py", line 1004, in _dispatch_on_db_driver
    if self._invoke_fn(fn, arg, kw) is not None:
  File "oslo_db/sqlalchemy/utils.py", line 953, in _invoke_fn
    return fn(*arg, **kw)
  File "oslo_db/sqlalchemy/engines.py", line 227, in _init_events
    _add_trace_comments(engine)
  File "oslo_db/sqlalchemy/engines.py", line 381, in _add_trace_comments
    os.path.dirname(sys.modules['oslo_db.tests'].__file__),
KeyError: 'oslo_db.tests'

Joshua Harlow (harlowja)
Changed in oslo.db:
assignee: nobody → Joshua Harlow (harlowja)
Revision history for this message
Viktor Serhieiev (vsergeyev) wrote :
Changed in oslo.db:
importance: Undecided → Medium
status: New → In Progress
Changed in oslo.db:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.