Browse Source

Merge "Make datetime format in log files to be configurable"

changes/82/763482/16
Zuul 5 months ago committed by Gerrit Code Review
parent
commit
9e1f318c81
  1. 6
      tobiko/openstack/topology/_neutron.py
  2. 4
      tobiko/openstack/topology/config.py

6
tobiko/openstack/topology/_neutron.py

@ -22,6 +22,7 @@ from oslo_log import log
import tobiko
from tobiko.openstack import neutron
from tobiko.openstack.topology import _config
from tobiko.openstack.topology import _topology
from tobiko.shell import files
@ -47,10 +48,13 @@ class NeutronNovaCommonReader(tobiko.SharedFixture):
log_digger: files.MultihostLogFileDigger
groups: typing.List[str]
message_pattern: str
datetime_pattern = re.compile(r'(\d{4}-\d{2}-\d{2} [0-9:.]+) .+')
datetime_pattern: typing.Pattern
config = tobiko.required_setup_fixture(_config.OpenStackTopologyConfig)
service_name = neutron.SERVER
def setup_fixture(self):
self.datetime_pattern = re.compile(
self.config.conf.log_datetime_pattern)
self.log_digger = self.useFixture(
_topology.get_log_file_digger(
service_name=self.service_name,

4
tobiko/openstack/topology/config.py

@ -35,6 +35,10 @@ OPTIONS = [
default=None,
choices=['', '4', '6'],
help="Limit connectivity to cloud to IPv4 o IPv6"),
cfg.StrOpt('log_datetime_pattern',
default=r"(\d{4}-\d{2}-\d{2} [0-9:.]+) .+",
help="Regex to be used to parse date and time from "
"the OpenStack services' log lines. "),
]

Loading…
Cancel
Save