Remove windows support

We deprecated it in 2024.1[1] so we can drop it now.

[1] f3693db5ee

Change-Id: I0a0ae4d4ce9b21c06fd5bfa306c35bb5d7c34ed4
This commit is contained in:
Takashi Kajinami
2024-10-18 00:43:20 +09:00
parent 0f5179e170
commit f47bed1fdf
4 changed files with 6 additions and 33 deletions

View File

@@ -113,11 +113,6 @@ generic_log_opts = [
default=False,
help='Log output to standard error. '
+ _IGNORE_MESSAGE),
cfg.BoolOpt('use_eventlog',
default=False,
deprecated_for_removal=True,
deprecated_reason='Windows support is no longer maintained.',
help='Log output to Windows Event Log.'),
cfg.BoolOpt('log_color',
default=False,
help='(Optional) Set the \'color\' key according to log '

View File

@@ -32,7 +32,6 @@ import logging
import logging.config
import logging.handlers
import os
import platform
import sys
try:
import syslog
@@ -418,14 +417,6 @@ def _setup_logging_from_conf(conf, project, version):
journal = handlers.OSJournalHandler(facility=facility)
log_root.addHandler(journal)
if conf.use_eventlog:
if platform.system() == 'Windows':
eventlog = logging.handlers.NTEventLogHandler(project)
log_root.addHandler(eventlog)
else:
raise RuntimeError(_("Windows Event Log is not available on this "
"platform."))
# if None of the above are True, then fall back to standard out
if not logpath and not conf.use_stderr and not conf.use_journal:
if conf.log_color:

View File

@@ -134,25 +134,6 @@ class CommonLoggerTestsMixIn(object):
'info', 'debug', 'log'):
self.assertRaises(AttributeError, getattr, log, func)
@mock.patch('platform.system', return_value='Linux')
def test_eventlog_missing(self, platform_mock):
self.config(use_eventlog=True)
self.assertRaises(RuntimeError,
log._setup_logging_from_conf,
self.CONF,
'test',
'test')
@mock.patch('platform.system', return_value='Windows')
@mock.patch('logging.handlers.NTEventLogHandler')
@mock.patch('oslo_log.log.getLogger')
def test_eventlog(self, loggers_mock, handler_mock, platform_mock):
self.config(use_eventlog=True)
log._setup_logging_from_conf(self.CONF, 'test', 'test')
handler_mock.assert_called_once_with('test')
mock_logger = loggers_mock.return_value.logger
mock_logger.addHandler.assert_any_call(handler_mock.return_value)
@mock.patch('logging.handlers.TimedRotatingFileHandler')
@mock.patch('oslo_log.log._get_log_file_path', return_value='test.conf')
def test_timed_rotate_log(self, path_mock, handler_mock):

View File

@@ -0,0 +1,6 @@
---
upgrade:
- |
Support for Windows operating systems has been removed. Because of
the removal, the deprecated ``[DEFAULT] use_eventlog`` option has been
removed.