From feca4a3f4a4a16797ee32743be834ac04a0873e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Wed, 24 Feb 2016 12:04:02 +0100 Subject: [PATCH] Remove duplicate code in magnum extend_start.sh Change-Id: Iaa7049834be784c7410970fb9f0b25086891211d Partial-Bug: #1546944 --- docker/magnum/magnum-api/Dockerfile.j2 | 4 ++-- docker/magnum/magnum-api/extend_start.sh | 7 ------- docker/magnum/magnum-base/Dockerfile.j2 | 3 ++- docker/magnum/magnum-base/extend_start.sh | 2 ++ 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/docker/magnum/magnum-api/Dockerfile.j2 b/docker/magnum/magnum-api/Dockerfile.j2 index 12ed125c6f..4df7ee911a 100644 --- a/docker/magnum/magnum-api/Dockerfile.j2 +++ b/docker/magnum/magnum-api/Dockerfile.j2 @@ -10,8 +10,8 @@ RUN yum -y install openstack-magnum-api \ {% 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_magnum_extend_start +RUN chmod 755 /usr/local/bin/kolla_magnum_extend_start {{ include_footer }} diff --git a/docker/magnum/magnum-api/extend_start.sh b/docker/magnum/magnum-api/extend_start.sh index d9922522be..0f92f6e7bf 100644 --- a/docker/magnum/magnum-api/extend_start.sh +++ b/docker/magnum/magnum-api/extend_start.sh @@ -1,12 +1,5 @@ #!/bin/bash -if [[ ! -d "/var/log/kolla/magnum" ]]; then - mkdir -p /var/log/kolla/magnum -fi -if [[ $(stat -c %a /var/log/kolla/magnum) != "755" ]]; then - chmod 755 /var/log/kolla/magnum -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/magnum/magnum-base/Dockerfile.j2 b/docker/magnum/magnum-base/Dockerfile.j2 index f57cc6df60..193b036881 100644 --- a/docker/magnum/magnum-base/Dockerfile.j2 +++ b/docker/magnum/magnum-base/Dockerfile.j2 @@ -24,4 +24,5 @@ RUN ln -s magnum-base-source/* magnum \ COPY extend_start.sh /usr/local/bin/kolla_extend_start RUN usermod -a -G kolla magnum \ - && chmod 755 /usr/local/bin/kolla_extend_start + && touch /usr/local/bin/kolla_magnum_extend_start \ + && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_magnum_extend_start diff --git a/docker/magnum/magnum-base/extend_start.sh b/docker/magnum/magnum-base/extend_start.sh index 0e91c4c6f8..8806cd2117 100644 --- a/docker/magnum/magnum-base/extend_start.sh +++ b/docker/magnum/magnum-base/extend_start.sh @@ -6,3 +6,5 @@ fi if [[ $(stat -c %a /var/log/kolla/magnum) != "755" ]]; then chmod 755 /var/log/kolla/magnum fi + +source /usr/local/bin/kolla_magnum_extend_start