summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openstack/common/cfg.py3
-rw-r--r--tests/unit/test_cfg.py11
2 files changed, 13 insertions, 1 deletions
diff --git a/openstack/common/cfg.py b/openstack/common/cfg.py
index acef6fb..f5b3a84 100644
--- a/openstack/common/cfg.py
+++ b/openstack/common/cfg.py
@@ -1756,11 +1756,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 e7d58ec..0279c6a 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):