diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-12-07 06:53:06 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-12-07 06:53:06 +0000 |
| commit | 5fb74870b5a93e370983eb65ecca1947775297b1 (patch) | |
| tree | 68c982243c242fd976605df3580b5c23694a3045 | |
| parent | 99b72e2d2b2fa9efa5e10083a7631c48f238bfd3 (diff) | |
| parent | 27b2ff42ce6bf13c394cf5516b220e8abc87a968 (diff) | |
| download | oslo-5fb74870b5a93e370983eb65ecca1947775297b1.tar.gz oslo-5fb74870b5a93e370983eb65ecca1947775297b1.tar.xz oslo-5fb74870b5a93e370983eb65ecca1947775297b1.zip | |
Merge "Add deprecated --logfile common opt."
| -rw-r--r-- | openstack/common/cfg.py | 3 | ||||
| -rw-r--r-- | tests/unit/test_cfg.py | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/openstack/common/cfg.py b/openstack/common/cfg.py index 99d4aa2..3d0ab45 100644 --- a/openstack/common/cfg.py +++ b/openstack/common/cfg.py @@ -1763,11 +1763,12 @@ class CommonConfigOpts(ConfigOpts): 'Default: %(default)s'), StrOpt('log-file', metavar='PATH', + deprecated_name='logfile', help='(Optional) Name of log file to output to. ' 'If not set, logging will go to stdout.'), StrOpt('log-dir', help='(Optional) The directory to keep log files in ' - '(will be prepended to --logfile)'), + '(will be prepended to --log-file)'), BoolOpt('use-syslog', default=False, help='Use syslog for logging.'), diff --git a/tests/unit/test_cfg.py b/tests/unit/test_cfg.py index f058d56..ef917ca 100644 --- a/tests/unit/test_cfg.py +++ b/tests/unit/test_cfg.py @@ -1608,6 +1608,17 @@ class CommonOptsTestCase(BaseTestCase): self.assertEquals(self.conf.use_syslog, False) + def test_log_file(self): + log_file = '/some/path/foo-bar.log' + self.conf(['--log-file', log_file]) + self.assertEquals(self.conf.log_file, log_file) + + def test_logfile(self): + logfile = '/some/other/path/foo-bar.log' + #NOTE(dprince): this is now a deprecated option for --log-file + self.conf(['--logfile', logfile]) + self.assertEquals(self.conf.log_file, logfile) + class ConfigParserTestCase(unittest.TestCase): def test_no_section(self): |
