The certificate_manager module in barbican/plugins/interface creates an instance of _CertificateEventPluginManager whithin that same module. the _CertificateEventPluginManager in turn, imports the plugins, which import the certificate_manager module itself. So in Centos we see that this causes an error when trying to import the modules:
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: cannot import name certificate_manager
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: Traceback (most recent call last):
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: File "/usr/lib/python2.7/site-packages/stevedore/extension.py", line 163, in _load_plugins
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: verify_requirements,
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: File "/usr/lib/python2.7/site-packages/stevedore/named.py", line 123, in _load_one_plugin
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: verify_requirements,
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: File "/usr/lib/python2.7/site-packages/stevedore/extension.py", line 184, in _load_one_plugin
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: plugin = ep.resolve()
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2208, in resolve
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: module = __import__(self.module_name, fromlist=['__name__'], level=0)
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: File "/usr/lib/python2.7/site-packages/barbican/plugin/simple_certificate_manager.py", line 19, in <module>
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: from barbican.plugin.interface import certificate_manager as cert
Apr 11 15:33:31 centos-7-ovh-gra1-54094 gunicorn[25012]: ImportError: cannot import name certificate_manager
This is due to the circular dependency I mentioned above.
Reviewed: https:/ /review. openstack. org/305624 /git.openstack. org/cgit/ openstack/ barbican/ commit/ ?id=4c6704eda78 bcac87b9bd17e6b d0e2f2c25d1429
Committed: https:/
Submitter: Jenkins
Branch: master
commit 4c6704eda78bcac 87b9bd17e6bd0e2 f2c25d1429
Author: Juan Antonio Osorio Robles <email address hidden>
Date: Thu Apr 14 06:31:26 2016 +0000
Fix circular dependency of certificate_manager module
The certificate_manager module had a circular dependency that made it MANAGER
problematic to use for certain versions of the python interpreter.
This was because we were initializing a singleton EVENT_PLUGIN_
that in turn loaded the plugins; The problem was that the plugins
imported certificate_manger themselves and this caused the circular
dependency. So instead of creating that class in the module, I
created a function that should be called instead.
Closes-Bug: #1570356 5ee561363f6ce13 248259f88d0
Change-Id: I9cdb7c3ecc9c27