Local variable 'domain_ref' referenced before assignment

Asked by Marcos Lobo

On keystone havana version. If you configure keystone.conf like this:

...
domain_specific_drivers_enabled = True
domain_config_dir = /etc/keystone/domains
...

After restart openstack-keystone service, if you execute this command for the first:

$keystone user-list

System raises this error

2014-01-29 15:57:46.606 9939 WARNING keystone.identity.core [-] Running an experimental and unsupported configuration (domain_specific_drivers_enabled = True); this will result in known issues.
2014-01-29 15:57:46.659 9939 WARNING keystone.identity.core [-] Invalid domain name (dominioldap) found in config file name
2014-01-29 15:57:46.659 9939 ERROR keystone.common.wsgi [-] local variable 'domain_ref' referenced before assignment
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi Traceback (most recent call last):
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi File "/usr/lib/python2.6/site-packages/keystone/common/wsgi.py", line 238, in __call__
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi result = method(context, **params)
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi File "/usr/lib/python2.6/site-packages/keystone/token/controllers.py", line 94, in authenticate
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi context, auth)
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi File "/usr/lib/python2.6/site-packages/keystone/token/controllers.py", line 257, in _authenticate_local
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi username, DEFAULT_DOMAIN_ID)
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi File "/usr/lib/python2.6/site-packages/keystone/identity/core.py", line 176, in wrapper
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi self.driver, self.assignment_api)
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi File "/usr/lib/python2.6/site-packages/keystone/identity/core.py", line 128, in setup_domain_drivers
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi names[1])
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi File "/usr/lib/python2.6/site-packages/keystone/identity/core.py", line 96, in _load_config
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi if domain_ref:
2014-01-29 15:57:46.659 9939 TRACE keystone.common.wsgi UnboundLocalError: local variable 'domain_ref' referenced before assignment

This problem is derived from the previous WARNING about the invalid domain name. However, there is a codification problem on /usr/lib/python2.6/site-packages/keystone/identity/core.py line 104, because if the DomainNotFound is raised (whatever reason) the "domain_ref" variable will never been initialized. Therefore on line 110 an uncontrolled error " local variable 'domain_ref' referenced before assignment" will be raised.

Question information

Language:
English Edit question
Status:
Open
For:
OpenStack Identity (keystone) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

Can you help with this problem?

Provide an answer of your own, or ask Marcos Lobo for more information if necessary.

To post a message you must log in.