circular import between opts and auth_token

Bug #1591913 reported by Alfredo Moralejo
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
keystonemiddleware
Fix Released
High
Samuel de Medeiros Queiroz

Bug Description

When i try to import keystonemiddleware opts i get following error:

from keystonemiddleware import opts
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "keystonemiddleware/opts.py", line 23, in <module>
    from keystonemiddleware.auth_token import _auth
  File "keystonemiddleware/auth_token/__init__.py", line 235, in <module>
    from keystonemiddleware import opts
ImportError: cannot import name opts

This seems to be caused by a circular imports between opts and auth_token.

This is causing other projects, as sahara to fail when trying to generate configuration.

Changed in keystonemiddleware:
assignee: nobody → Alfredo Moralejo (amoralej)
status: New → In Progress
Revision history for this message
Samuel de Medeiros Queiroz (samueldmq) wrote :

I was not able to reproduce it in an Ubuntu VM with a fresh DevStack installation:

stack@openstack:~/devstack$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from keystonemiddleware import opts
>>>

I confirmed with EmilienM and jaosorior in IRC tahat this is only happens on a CentOS system because of the Python interpreter that is shipped with it.

Perhaps a way to test it would be to have gates runnning on CentOS.

Changed in keystonemiddleware:
importance: Undecided → High
Revision history for this message
Samuel de Medeiros Queiroz (samueldmq) wrote :

From the current commit message: "This was introduced in https://review.openstack.org/#/c/319715/."

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystonemiddleware (master)

Fix proposed to branch: master
Review: https://review.openstack.org/329091

Changed in keystonemiddleware:
assignee: Alfredo Moralejo (amoralej) → Samuel de Medeiros Queiroz (samueldmq)
Changed in keystonemiddleware:
assignee: Samuel de Medeiros Queiroz (samueldmq) → Alfredo Moralejo (amoralej)
Changed in keystonemiddleware:
assignee: Alfredo Moralejo (amoralej) → Samuel de Medeiros Queiroz (samueldmq)
assignee: Samuel de Medeiros Queiroz (samueldmq) → Alfredo Moralejo (amoralej)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystonemiddleware (master)

Change abandoned by Alfredo Moralejo (<email address hidden>) on branch: master
Review: https://review.openstack.org/328919
Reason: Abandoned in favor of https://review.openstack.org/#/c/329091/ .

Changed in keystonemiddleware:
assignee: Alfredo Moralejo (amoralej) → Samuel de Medeiros Queiroz (samueldmq)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystonemiddleware (master)

Reviewed: https://review.openstack.org/329091
Committed: https://git.openstack.org/cgit/openstack/keystonemiddleware/commit/?id=cc58b62f1120f5a1b436618be82aea7c1a16a281
Submitter: Jenkins
Branch: master

commit cc58b62f1120f5a1b436618be82aea7c1a16a281
Author: Samuel de Medeiros Queiroz <email address hidden>
Date: Mon Jun 13 13:21:06 2016 -0300

    Move auth token opts calculation into auth_token

    The list of all auth token opts is currently calculated in opts.py.
    That module is included in auth_token/__init__.py, which in turn owns
    some opts that are needed by the former.

    This creates a circular import dependency.

    In order to fix such situation, this patch proposes to move the auth
    token opts calculation into auth_token/__init__.py, so that it will
    no longer need opts.py.

    Co-Authored-By: Alfredo Moralejo <email address hidden>

    Closes-Bug: #1591913
    Change-Id: If67d8bdb68a5ab9c07b960ad0111e2310ad82c83

Changed in keystonemiddleware:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/keystonemiddleware 4.6.0

This issue was fixed in the openstack/keystonemiddleware 4.6.0 release.

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.