Comment 23 for bug 1217017

Revision history for this message
Henry Nash (henry-nash) wrote : Re: [Bug 1217017] Re: Can't use sql as domain-specific driver

Yes, it is.

Henry
On 16 Oct 2014, at 09:56, Bruno Bompastor <email address hidden> wrote:

> I think this is present on rc2, isnt it?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1217017
>
> Title:
> Can't use sql as domain-specific driver
>
> Status in OpenStack Identity (Keystone):
> Fix Released
>
> Bug description:
> File “/keystone/common/dependency.py” has a method named “requires”
> which is a decorator for the “Assignment” class of both files
> “/keystone/assignment/backends/ldap.py” and
> “/keystone/assignment/backends/sql.py”.
>
> File “/keystone/assignment/backends/ldap.py”:
>
> @dependency.requires('identity_api')
> class Assignment(assignment.Driver):
>
> File “/keystone/assignment/backends/sql.py”:
>
> @dependency.requires('identity_api')
> class Assignment(sql.Base, assignment.Driver):
>
> When I specify the following contents for file
> “/etc/keystone/domains/keystone.Default.conf” I am telling Keystone to
> use an SQL backend for the default domain:
>
> [assignment]
> driver = keystone.assignment.backends.sql.Assignment
>
> [identity]
> driver = keystone.identity.backends.sql.Identity
>
> [ldap]
>
> However, there is a problem with the following line in method requires
> of file “dependency.py”:
>
> def wrapper(self, *args, **kwargs):
> """Inject each dependency from the registry."""
> self.__wrapped_init__(*args, **kwargs)
>
> for dependency in self._dependencies:
> if dependency not in REGISTRY:
> if dependency in _future_dependencies:
> _future_dependencies[dependency] += [self]
> else:
> _future_dependencies[dependency] = [self]
>
> continue
>
> setattr(self, dependency, REGISTRY[dependency])
>
> because it is passing arguments to the constructor of the Assignment
> class in file “/keystone/assignment/backends/sql.py” which extends the
> sql.Base class (i.e. class Base(object) of file
> “/keystone/common/sql/core.py“) that extends class “object” which does
> not accept any parameters for its constructor. It took me a full day
> to pin this one down.
>
> To get around this problem I added the following lines to class
> Base(object) of file “/keystone/common/sql/core.py“ in order to accept
> any number of parameters:
>
> def __init__(self, *args, **kwargs):
> super(Base, self).__init__()
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/keystone/+bug/1217017/+subscriptions
>