From 1382e39f162d827199a8baa39cffb9c1812cc3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Wed, 24 Feb 2016 11:48:06 +0100 Subject: [PATCH] Remove duplicate code in cinder extend_start.sh Change-Id: I71953c905b978176bf7dc6bcaf3c4766be4b60fb Partial-Bug: #1546944 --- docker/cinder/cinder-api/Dockerfile.j2 | 4 ++-- docker/cinder/cinder-api/extend_start.sh | 7 ------- docker/cinder/cinder-base/Dockerfile.j2 | 3 ++- docker/cinder/cinder-base/extend_start.sh | 2 ++ 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/docker/cinder/cinder-api/Dockerfile.j2 b/docker/cinder/cinder-api/Dockerfile.j2 index d9b819e5dc..60c69a7c51 100644 --- a/docker/cinder/cinder-api/Dockerfile.j2 +++ b/docker/cinder/cinder-api/Dockerfile.j2 @@ -16,8 +16,8 @@ RUN apt-get install -y --no-install-recommends \ {% endif %} {% endif %} -COPY extend_start.sh /usr/local/bin/kolla_extend_start -RUN chmod 755 /usr/local/bin/kolla_extend_start +COPY extend_start.sh /usr/local/bin/kolla_cinder_extend_start +RUN chmod 755 /usr/local/bin/kolla_cinder_extend_start {{ include_footer }} diff --git a/docker/cinder/cinder-api/extend_start.sh b/docker/cinder/cinder-api/extend_start.sh index f6e2ddb205..176515189d 100644 --- a/docker/cinder/cinder-api/extend_start.sh +++ b/docker/cinder/cinder-api/extend_start.sh @@ -1,13 +1,6 @@ #!/bin/bash set -o errexit -if [[ ! -d "/var/log/kolla/cinder" ]]; then - mkdir -p /var/log/kolla/cinder -fi -if [[ $(stat -c %a /var/log/kolla/cinder) != "755" ]]; then - chmod 755 /var/log/kolla/cinder -fi - # Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases # of the KOLLA_BOOTSTRAP variable being set, including empty. if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then diff --git a/docker/cinder/cinder-base/Dockerfile.j2 b/docker/cinder/cinder-base/Dockerfile.j2 index 46e87198a7..46eddd25e6 100644 --- a/docker/cinder/cinder-base/Dockerfile.j2 +++ b/docker/cinder/cinder-base/Dockerfile.j2 @@ -58,4 +58,5 @@ COPY extend_start.sh /usr/local/bin/kolla_extend_start RUN usermod -a -G kolla cinder \ && chmod 750 /etc/sudoers.d \ && chmod 440 /etc/sudoers.d/cinder_sudoers \ - && chmod 755 /usr/local/bin/kolla_extend_start + && touch /usr/local/bin/kolla_cinder_extend_start \ + && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_cinder_extend_start diff --git a/docker/cinder/cinder-base/extend_start.sh b/docker/cinder/cinder-base/extend_start.sh index 2652bf2642..6c655da29b 100644 --- a/docker/cinder/cinder-base/extend_start.sh +++ b/docker/cinder/cinder-base/extend_start.sh @@ -6,3 +6,5 @@ fi if [[ $(stat -c %a /var/log/kolla/cinder) != "755" ]]; then chmod 755 /var/log/kolla/cinder fi + +source /usr/local/bin/kolla_cinder_extend_start