keystone-manage mapping_populate fails when wrong domain name is given and gives unhandled exception

Bug #1645571 reported by the-bling
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
Samuel de Medeiros Queiroz

Bug Description

Running keystone-manage mapping_populate --domain-name <domain name> where no such domain name exists, fails silently with no error message displayed on screen.
The logs from keystone.log is displayed below.

2016-11-18 07:22:26.470 1384 CRITICAL keystone [req-a2de669b-a645-42b0-8af6-a36e1cf53c54 - - - - -] UnboundLocalError: local variable 'domain_id' referenced before assignment
2016-11-18 07:22:26.470 1384 ERROR keystone Traceback (most recent call last):
2016-11-18 07:22:26.470 1384 ERROR keystone File "/usr/bin/keystone-manage", line 10, in <module>
2016-11-18 07:22:26.470 1384 ERROR keystone sys.exit(main())
2016-11-18 07:22:26.470 1384 ERROR keystone File "/usr/lib/python2.7/site-packages/keystone/cmd/manage.py", line 43, in main
2016-11-18 07:22:26.470 1384 ERROR keystone cli.main(argv=sys.argv, config_files=config_files)
2016-11-18 07:22:26.470 1384 ERROR keystone File "/usr/lib/python2.7/site-packages/keystone/cmd/cli.py", line 1256, in main
2016-11-18 07:22:26.470 1384 ERROR keystone CONF.command.cmd_class.main()
2016-11-18 07:22:26.470 1384 ERROR keystone File "/usr/lib/python2.7/site-packages/keystone/cmd/cli.py", line 1202, in main
2016-11-18 07:22:26.470 1384 ERROR keystone 'domain': domain_id})
2016-11-18 07:22:26.470 1384 ERROR keystone UnboundLocalError: local variable 'domain_id' referenced before assignment
2016-11-18 07:22:26.470 1384 ERROR keystone

My guess is that instead of printing domain_id, we should print domain_name to avoid the error.

Tags: newton
the-bling (the-bling)
summary: - keystone-manage mapping_populate fails and try catch doesn't work
+ keystone-manage mapping_populate fails and gives unhandled exception
the-bling (the-bling)
description: updated
tags: added: newton
the-bling (the-bling)
summary: - keystone-manage mapping_populate fails and gives unhandled exception
+ keystone-manage mapping_populate fails when wrong domain name is given
+ and gives unhandled exception
the-bling (the-bling)
Changed in keystone:
assignee: nobody → the-bling (the-bling)
Changed in keystone:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
assignee: the-bling (the-bling) → Boris Bobrov (bbobrov)
status: Confirmed → In Progress
Changed in keystone:
assignee: Boris Bobrov (bbobrov) → Steve Martinelli (stevemar)
Changed in keystone:
assignee: Steve Martinelli (stevemar) → Boris Bobrov (bbobrov)
importance: Undecided → Low
milestone: none → ocata-2
Changed in keystone:
assignee: Boris Bobrov (bbobrov) → Samuel de Medeiros Queiroz (samueldmq)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/404197
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=6b16e2cf88f775919eaf8f115986bcdc2aba1e68
Submitter: Jenkins
Branch: master

commit 6b16e2cf88f775919eaf8f115986bcdc2aba1e68
Author: Boris Bobrov <email address hidden>
Date: Tue Nov 29 15:33:17 2016 +0300

    Print domain name in mapping_populate error message

    domain_id was not defined at the moment when it was referenced and
    it caused UnboundLocalError.

    Use domain name instead and test it.

    Change-Id: Ib351df0942025451994873e272861afec1b60dea
    Closes-Bug: 1645571

Changed in keystone:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystone 11.0.0.0b2

This issue was fixed in the openstack/keystone 11.0.0.0b2 development milestone.

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.