Default configuration values are ignored

Bug #949373 reported by Devin Carlen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
High
termie

Bug Description

When making the bind host configurable, I noticed that the 'default' param on register_str is ignored.

register_str('bind_host', default='0.0.0.0')

Joseph Heck (heckj)
Changed in keystone:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Joseph Heck (heckj)
milestone: none → essex-rc1
Revision history for this message
Alan Pevec (apevec) wrote :

I'm pretty sure this would be fixed by applying markmc's cfg-cleanup branch.

Revision history for this message
Joseph Heck (heckj) wrote :

I think it is too - the ConfigMixin() setup in keystone/config.py has me stumbling over this a bit. I'm assigning the bug to termie because I need his help to get this resolved:

I think I'm not quite grokking how the override of __call__() does it's magic. Here's what I'm seeing (and what I'm trying to do).

I tried a
 CONF(sys.argv[1:])

in keystone-all right after the CONF was configured with a config file. I stepped through it in pdb, and what we get into the ConfigMixin __call__() method, the parameters there are getting pulled in as config_files, causing all sorts of havoc.

Any idea how to get into those into the subclasses' (ConfigOpts) __call__ method?

While trying to work around it, it looks like the wrappers in for keystone.config.register_* are also making it so that config options defined in keystone/config.py aren't embedded into expected subdicts

i.e.

    CONF._cli_values inspected from pdb right after the whole critter is loaded:

(Pdb) CONF._cli_values
{'log_date_format': None, 'config_file': None, 'verbose': None, 'use_syslog': None, 'log_dir': None, 'syslog_log_facility': None, 'debug': None, 'log_format': None, 'log_file': None, 'log_config': None}

Changed in keystone:
assignee: Joseph Heck (heckj) → termie (termie)
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/5577

Changed in keystone:
status: Confirmed → In Progress
Revision history for this message
termie (termie) wrote :

this doesn't appear to be the case, actually, it was just using some old stuff in keystone-all that wasn't going through the config system

anyway, commented out the value in keystone.conf and ran keystone-all after fixing that usage and everything appears to be in order:

(see change: https://review.openstack.org/#change,5577)

(ksl)termie@termie:~/p/keystone % ./bin/keystone-all [accept_cli] 10:46:22
2012-03-20 10:46:27 DEBUG [keystone-all] ********************************************************************************
2012-03-20 10:46:27 DEBUG [keystone-all] Configuration options gathered from:
2012-03-20 10:46:27 DEBUG [keystone-all] command line args: ['./bin/keystone-all']
2012-03-20 10:46:27 DEBUG [keystone-all] config files: ['/Users/termie/p/keystone/etc/keystone.conf']
2012-03-20 10:46:27 DEBUG [keystone-all] ================================================================================
2012-03-20 10:46:27 DEBUG [keystone-all] admin_port = 35357
2012-03-20 10:46:27 DEBUG [keystone-all] admin_token = ADMIN
2012-03-20 10:46:27 DEBUG [keystone-all] bind_host = 0.0.0.0
2012-03-20 10:46:27 DEBUG [keystone-all] compute_port = 8774
2012-03-20 10:46:27 DEBUG [keystone-all] config_file = ['/Users/termie/p/keystone/etc/keystone.conf']
2012-03-20 10:46:27 DEBUG [keystone-all] crypt_strength = 40000
2012-03-20 10:46:27 DEBUG [keystone-all] debug = True
2012-03-20 10:46:27 DEBUG [keystone-all] log_config = None
2012-03-20 10:46:27 DEBUG [keystone-all] log_date_format = %Y-%m-%d %H:%M:%S
2012-03-20 10:46:27 DEBUG [keystone-all] log_dir = None
2012-03-20 10:46:27 DEBUG [keystone-all] log_file = None
2012-03-20 10:46:27 DEBUG [keystone-all] log_format = %(asctime)s %(levelname)8s [%(name)s] %(message)s
2012-03-20 10:46:27 DEBUG [keystone-all] public_port = 5000
2012-03-20 10:46:27 DEBUG [keystone-all] syslog_log_facility = LOG_USER
2012-03-20 10:46:27 DEBUG [keystone-all] use_syslog = False
2012-03-20 10:46:27 DEBUG [keystone-all] verbose = True

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

Reviewed: https://review.openstack.org/5577
Committed: http://github.com/openstack/keystone/commit/3e4653a3914e84aec72ba159c4d23edba8ced48f
Submitter: Jenkins
Branch: master

commit 3e4653a3914e84aec72ba159c4d23edba8ced48f
Author: termie <email address hidden>
Date: Tue Mar 20 10:47:31 2012 -0700

    fix keystone-all's usage of options vs conf

    we shouldn't be using options at all, that was a leftover piece of code
    from a long time ago.

    invalidates bug 949373

    Change-Id: I29fcbd5f641464bda985900172b55bca45843f81

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: essex-rc1 → 2012.1
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.