Merge "Make oslo.log work properly with syslog"

This commit is contained in:
Jenkins 2015-09-28 20:50:20 +00:00 committed by Gerrit Code Review
commit 44b5e223f2
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,36 @@
From ff277ae1e9b53b1844ecc220383ab9d39f954881 Mon Sep 17 00:00:00 2001
From: Masaki Matsushita <glass.saga@gmail.com>
Date: Fri, 25 Sep 2015 15:29:38 +0900
Subject: [PATCH] Fix unintended assignment of "syslog"
Identifier "syslog" is unintendedly reassigned in _setup_logging_from_conf()
with OSSysLogHandler.
It causes an error in _find_facility() which expects "syslog" as module.
This change fixes the problem.
Change-Id: Icd8486bc008028f6f78f0306d835bf2c4fb9245b
Closes-Bug: #1499620
---
oslo_log/log.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/oslo_log/log.py b/oslo_log/log.py
index 7ec89be..9f3949f 100644
--- a/oslo_log/log.py
+++ b/oslo_log/log.py
@@ -343,10 +343,10 @@ def _setup_logging_from_conf(conf, project, version):
facility = _find_facility(conf.syslog_log_facility)
# TODO(bogdando) use the format provided by RFCSysLogHandler after
# existing syslog format deprecation in J
- syslog = handlers.OSSysLogHandler(
+ syslog_handler = handlers.OSSysLogHandler(
facility=facility,
use_syslog_rfc_format=conf.use_syslog_rfc_format)
- log_root.addHandler(syslog)
+ log_root.addHandler(syslog_handler)
datefmt = conf.log_date_format
for handler in log_root.handlers:
--
2.1.0

View File

@ -1,6 +1,13 @@
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
MAINTAINER Kolla Project (https://launchpad.net/kolla)
{% if base_distro in ['fedora', 'centos', 'oraclelinux', 'rhel'] %}
RUN yum -y install patch \
&& yum clean all
{% endif %}
{% if install_type == 'source' %}
{% if base_distro in ['ubuntu', 'debian'] %}
@ -14,6 +21,7 @@ RUN apt-get install -y --no-install-recommends \
libxslt1-dev \
libffi-dev \
libyaml-dev \
patch \
pkg-config \
git \
&& apt-get clean
@ -43,3 +51,10 @@ RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \
MySQL-python
{% endif %}
# TODO(sdake): Remove a backport of a patch which is not yet in the packaging
# to make oslo.log work properly once the patch is in oslo.log
# NB: Please remove patch from the list of packages for both
# RPM and APT.
COPY 0001-Fix-unintended-assignment-of-syslog.patch /
RUN patch -p1 -d /usr/lib/python2.7/site-packages < /0001-Fix-unintended-assignment-of-syslog.patch