diff --git a/docker/openstack-base/0001-Fix-unintended-assignment-of-syslog.patch b/docker/openstack-base/0001-Fix-unintended-assignment-of-syslog.patch new file mode 100644 index 0000000000..de8be1a159 --- /dev/null +++ b/docker/openstack-base/0001-Fix-unintended-assignment-of-syslog.patch @@ -0,0 +1,36 @@ +From ff277ae1e9b53b1844ecc220383ab9d39f954881 Mon Sep 17 00:00:00 2001 +From: Masaki Matsushita +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 + diff --git a/docker/openstack-base/Dockerfile.j2 b/docker/openstack-base/Dockerfile.j2 index 893014088a..36c1c1c347 100644 --- a/docker/openstack-base/Dockerfile.j2 +++ b/docker/openstack-base/Dockerfile.j2 @@ -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