From 63e2c64081c384548daff46b5db8dfa3c97f9c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Wed, 24 Feb 2016 11:41:23 +0100 Subject: [PATCH] Remove duplicate code in glance extend_start.sh Change-Id: I34f63aef2a473c475f3740e160f64e6c1ee758fc Partial-Bug: #1546944 --- docker/glance/glance-api/Dockerfile.j2 | 4 ++-- docker/glance/glance-api/extend_start.sh | 7 ------- docker/glance/glance-base/Dockerfile.j2 | 3 ++- docker/glance/glance-base/extend_start.sh | 2 ++ 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/docker/glance/glance-api/Dockerfile.j2 b/docker/glance/glance-api/Dockerfile.j2 index 60945a6fe8..f195defdd9 100644 --- a/docker/glance/glance-api/Dockerfile.j2 +++ b/docker/glance/glance-api/Dockerfile.j2 @@ -1,8 +1,8 @@ FROM {{ namespace }}/{{ image_prefix }}glance-base:{{ tag }} MAINTAINER {{ maintainer }} -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_glance_extend_start +RUN chmod 755 /usr/local/bin/kolla_glance_extend_start {{ include_footer }} diff --git a/docker/glance/glance-api/extend_start.sh b/docker/glance/glance-api/extend_start.sh index aa0372fdcc..4b99201c9c 100644 --- a/docker/glance/glance-api/extend_start.sh +++ b/docker/glance/glance-api/extend_start.sh @@ -1,12 +1,5 @@ #!/bin/bash -if [[ ! -d "/var/log/kolla/glance" ]]; then - mkdir -p /var/log/kolla/glance -fi -if [[ $(stat -c %a /var/log/kolla/glance) != "755" ]]; then - chmod 755 /var/log/kolla/glance -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/glance/glance-base/Dockerfile.j2 b/docker/glance/glance-base/Dockerfile.j2 index 74edfc72df..c1f3519f9e 100644 --- a/docker/glance/glance-base/Dockerfile.j2 +++ b/docker/glance/glance-base/Dockerfile.j2 @@ -56,4 +56,5 @@ COPY extend_start.sh /usr/local/bin/kolla_extend_start RUN usermod -a -G kolla glance \ && chmod 750 /etc/sudoers.d \ && chmod 440 /etc/sudoers.d/glance_sudoers \ - && chmod 755 /usr/local/bin/kolla_extend_start + && touch /usr/local/bin/kolla_glance_extend_start \ + && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_glance_extend_start diff --git a/docker/glance/glance-base/extend_start.sh b/docker/glance/glance-base/extend_start.sh index 467a2e1888..e8a60bf648 100644 --- a/docker/glance/glance-base/extend_start.sh +++ b/docker/glance/glance-base/extend_start.sh @@ -6,3 +6,5 @@ fi if [[ $(stat -c %a /var/log/kolla/glance) != "755" ]]; then chmod 755 /var/log/kolla/glance fi + +source /usr/local/bin/kolla_glance_extend_start