Merge "Fix haproxy user flow log format substitution"

This commit is contained in:
Zuul 2020-08-06 20:09:42 +00:00 committed by Gerrit Code Review
commit d78e992a9e
3 changed files with 7 additions and 6 deletions

View File

@ -357,8 +357,9 @@ haproxy_amphora_opts = [
help=_('Size of the HAProxy stick table. Accepts k, m, g '
'suffixes. Example: 10k')),
cfg.StrOpt('user_log_format',
default='{project_id} {lb_id} %f %ci %cp %t %{+Q}r %ST %B %U '
'%[ssl_c_verify] %{+Q}[ssl_c_s_dn] %b %s %Tt %tsc',
default='{{ project_id }} {{ lb_id }} %f %ci %cp %t %{+Q}r %ST '
'%B %U %[ssl_c_verify] %{+Q}[ssl_c_s_dn] %b %s %Tt '
'%tsc',
help=_('Log format string for user flow logging.')),
# REST server

View File

@ -121,8 +121,8 @@ class JinjaTemplater(object):
def _format_log_string(self, load_balancer, protocol):
log_format = CONF.haproxy_amphora.user_log_format.replace(
'{project_id}', load_balancer.project_id)
log_format = log_format.replace('{lb_id}', load_balancer.id)
'{{ project_id }}', load_balancer.project_id)
log_format = log_format.replace('{{ lb_id }}', load_balancer.id)
# Order of these filters matter.
# TODO(johnsom) Remove when HAProxy handles the format string

View File

@ -122,8 +122,8 @@ class JinjaTemplater(object):
def _format_log_string(self, load_balancer, protocol):
log_format = CONF.haproxy_amphora.user_log_format.replace(
'{project_id}', load_balancer.project_id)
log_format = log_format.replace('{lb_id}', load_balancer.id)
'{{ project_id }}', load_balancer.project_id)
log_format = log_format.replace('{{ lb_id }}', load_balancer.id)
# Order of these filters matter.
# TODO(johnsom) Remove when HAProxy handles the format string