Merge lp:~jaypipes/glance/bug759012 into lp:~glance-coresec/glance/cactus-trunk

Proposed by Jay Pipes
Status: Merged
Approved by: Jay Pipes
Approved revision: 111
Merged at revision: 112
Proposed branch: lp:~jaypipes/glance/bug759012
Merge into: lp:~glance-coresec/glance/cactus-trunk
Diff against target: 33 lines (+9/-5)
1 file modified
glance/common/config.py (+9/-5)
To merge this branch: bzr merge lp:~jaypipes/glance/bug759012
Reviewer Review Type Date Requested Status
Rick Harris (community) Approve
Thierry Carrez (community) Approve
Review via email: mp+57402@code.launchpad.net

Description of the change

Ensures that configuration values for debug and verbose are used if command-line options are not set.

To post a comment you must log in.
Revision history for this message
Thierry Carrez (ttx) wrote :

Hrm...

conf['verbose'] = debug
conf['debug'] = verbose

You surely meant the other way around ?

review: Needs Fixing
Revision history for this message
Jay Pipes (jaypipes) wrote :

doh. doh again!

Revision history for this message
Jay Pipes (jaypipes) wrote :

ok, fixed.

Revision history for this message
Thierry Carrez (ttx) wrote :

lgtm

review: Approve
Revision history for this message
Rick Harris (rconradharris) wrote :

Received a test failure: http://paste.openstack.org/show/1180/

Otherwise, code looks good.

review: Needs Fixing
Revision history for this message
Rick Harris (rconradharris) wrote :

Looks like I'm getting this test failure in trunk, so it's unrelated to this particular patch. Marking as approved. I'll swing around and debug this issue separately.

review: Approve
Revision history for this message
Jay Pipes (jaypipes) wrote :

On Wed, Apr 13, 2011 at 12:27 PM, Rick Harris <email address hidden> wrote:
> Review: Needs Fixing
> Received a test failure: http://paste.openstack.org/show/1180/
>
> Otherwise, code looks good.

Actually, it's unrelated to this patch.
https://bugs.launchpad.net/glance/+bug/759018

-jay

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'glance/common/config.py'
2--- glance/common/config.py 2011-04-04 17:00:26 +0000
3+++ glance/common/config.py 2011-04-13 12:57:33 +0000
4@@ -133,8 +133,10 @@
5 raise RuntimeError("Unable to locate specified logging "
6 "config file: %s" % options['log_config'])
7
8- debug = options.get('debug', False)
9- verbose = options.get('verbose', False)
10+ # If either the CLI option or the conf value
11+ # is True, we set to True
12+ debug = options.get('debug') or conf.get('debug', False)
13+ verbose = options.get('verbose') or conf.get('verbose', False)
14 root_logger = logging.root
15 if debug:
16 root_logger.setLevel(logging.DEBUG)
17@@ -276,11 +278,13 @@
18
19 # We only update the conf dict for the verbose and debug
20 # flags. Everything else must be set up in the conf file...
21- conf['verbose'] = options['verbose']
22- conf['debug'] = options['debug']
23+ debug = options.get('debug') or conf.get('debug', False)
24+ verbose = options.get('verbose') or conf.get('verbose', False)
25+ conf['debug'] = debug
26+ conf['verbose'] = verbose
27
28 # Log the options used when starting if we're in debug mode...
29- if conf['debug']:
30+ if debug:
31 logger = logging.getLogger(app_name)
32 logger.debug("*" * 80)
33 logger.debug("Configuration options gathered from config file:")

Subscribers

People subscribed via source and target branches