diff options
| author | Zhongyue Luo <lzyeval@gmail.com> | 2012-02-11 20:18:08 +0800 |
|---|---|---|
| committer | Zhongyue Luo <lzyeval@gmail.com> | 2012-02-11 23:22:54 +0800 |
| commit | 684ea9f2eef2926d3e5856eea124a47e475ff3ae (patch) | |
| tree | 62d1ebebf3dcd3690e086fab01cc1124067e6fbb /openstack/common/config.py | |
| parent | 2ad09351f3c4f69ffcae16815b76eb28cb07a9b7 (diff) | |
| download | oslo-684ea9f2eef2926d3e5856eea124a47e475ff3ae.tar.gz oslo-684ea9f2eef2926d3e5856eea124a47e475ff3ae.tar.xz oslo-684ea9f2eef2926d3e5856eea124a47e475ff3ae.zip | |
PEP8 cleanup (openstack-common)
Fixes bug #930625
Remove backslash continuations in openstack-common.
Fix type checking taboos.
Change-Id: I49ddb9ff5fa5af760dcfccb52cb4793b71e02f19
Diffstat (limited to 'openstack/common/config.py')
| -rw-r--r-- | openstack/common/config.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/openstack/common/config.py b/openstack/common/config.py index a5fc3f0..7ae703e 100644 --- a/openstack/common/config.py +++ b/openstack/common/config.py @@ -62,8 +62,8 @@ def add_common_options(parser): :param parser: optparse.OptionParser """ - help_text = "The following configuration options are common to "\ - "this app's programs." + help_text = ("The following configuration options are common to " + "this app's programs.") group = optparse.OptionGroup(parser, "Common Options", help_text) group.add_option('-v', '--verbose', default=False, dest="verbose", @@ -88,8 +88,8 @@ def add_log_options(parser): :param parser: optparse.OptionParser """ - help_text = "The following configuration options are specific to logging "\ - "functionality for this program." + help_text = ("The following configuration options are specific to " + "logging functionality for this program.") group = optparse.OptionGroup(parser, "Logging Options", help_text) group.add_option('--log-config', default=None, metavar="PATH", @@ -133,10 +133,10 @@ def setup_logging(options, conf): # If either the CLI option or the conf value # is True, we set to True - debug = options.get('debug') or \ - get_option(conf, 'debug', type='bool', default=False) - verbose = options.get('verbose') or \ - get_option(conf, 'verbose', type='bool', default=False) + debug = (options.get('debug') or + get_option(conf, 'debug', type='bool', default=False)) + verbose = (options.get('verbose') or + get_option(conf, 'verbose', type='bool', default=False)) root_logger = logging.root if debug: root_logger.setLevel(logging.DEBUG) @@ -157,8 +157,8 @@ def setup_logging(options, conf): if not logfile: logfile = conf.get('log_file') - use_syslog = options.get('use_syslog') or \ - get_option(conf, 'use_syslog', type='bool', default=False) + use_syslog = (options.get('use_syslog') or + get_option(conf, 'use_syslog', type='bool', default=False)) if use_syslog: handler = logging.handlers.SysLogHandler(address='/dev/log') @@ -289,10 +289,10 @@ def load_paste_app(app_name, options, args, config_dir=None): # We only update the conf dict for the verbose and debug # flags. Everything else must be set up in the conf file... - debug = options.get('debug') or \ - get_option(conf, 'debug', type='bool', default=False) - verbose = options.get('verbose') or \ - get_option(conf, 'verbose', type='bool', default=False) + debug = (options.get('debug') or + get_option(conf, 'debug', type='bool', default=False)) + verbose = (options.get('verbose') or + get_option(conf, 'verbose', type='bool', default=False)) conf['debug'] = debug conf['verbose'] = verbose |
