Remove duplicate code in neutron extend_start.sh

Change-Id: I74aa68d809e9b38a605093abc4e2b8ca14335dee
Partial-Bug: #1546944
This commit is contained in:
Éric Lemoine 2016-02-24 11:29:09 +01:00
parent 3f8bc07270
commit 509acbb83f
6 changed files with 8 additions and 19 deletions

View File

@ -64,4 +64,5 @@ COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN usermod -a -G kolla neutron \ RUN usermod -a -G kolla neutron \
&& chmod 750 /etc/sudoers.d \ && chmod 750 /etc/sudoers.d \
&& chmod 440 /etc/sudoers.d/neutron_sudoers \ && chmod 440 /etc/sudoers.d/neutron_sudoers \
&& chmod 755 /usr/local/bin/kolla_extend_start && touch /usr/local/bin/kolla_neutron_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_neutron_extend_start

View File

@ -6,3 +6,5 @@ fi
if [[ $(stat -c %a /var/log/kolla/neutron) != "755" ]]; then if [[ $(stat -c %a /var/log/kolla/neutron) != "755" ]]; then
chmod 755 /var/log/kolla/neutron chmod 755 /var/log/kolla/neutron
fi fi
source /usr/local/bin/kolla_neutron_extend_start

View File

@ -12,8 +12,8 @@ RUN apt-get install -y --no-install-recommends \
{% endif %} {% endif %}
COPY neutron_sudoers /etc/sudoers.d/neutron_sudoers COPY neutron_sudoers /etc/sudoers.d/neutron_sudoers
COPY extend_start.sh /usr/local/bin/kolla_extend_start COPY extend_start.sh /usr/local/bin/kolla_neutron_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start \ RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start \
&& chmod 750 /etc/sudoers.d \ && chmod 750 /etc/sudoers.d \
&& chmod 440 /etc/sudoers.d/neutron_sudoers \ && chmod 440 /etc/sudoers.d/neutron_sudoers \
&& usermod -a -G kolla neutron && usermod -a -G kolla neutron

View File

@ -4,10 +4,3 @@
if [[ $(stat -c %U:%G /var/lib/neutron/kolla) != "neutron:neutron" ]]; then if [[ $(stat -c %U:%G /var/lib/neutron/kolla) != "neutron:neutron" ]]; then
sudo chown neutron: /var/lib/neutron/kolla sudo chown neutron: /var/lib/neutron/kolla
fi fi
if [[ ! -d "/var/log/kolla/neutron" ]]; then
mkdir -p /var/log/kolla/neutron
fi
if [[ $(stat -c %a /var/log/kolla/neutron) != "755" ]]; then
chmod 755 /var/log/kolla/neutron
fi

View File

@ -2,8 +2,8 @@ FROM {{ namespace }}/{{ image_prefix }}neutron-base:{{ tag }}
MAINTAINER {{ maintainer }} MAINTAINER {{ maintainer }}
ADD plugins-archive / ADD plugins-archive /
COPY extend_start.sh /usr/local/bin/kolla_extend_start COPY extend_start.sh /usr/local/bin/kolla_neutron_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start \ RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start \
&& if [ "$(ls /plugins)" ]; then \ && if [ "$(ls /plugins)" ]; then \
pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /plugins/*; \ pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /plugins/*; \
fi fi

View File

@ -1,12 +1,5 @@
#!/bin/bash #!/bin/bash
if [[ ! -d "/var/log/kolla/neutron" ]]; then
mkdir -p /var/log/kolla/neutron
fi
if [[ $(stat -c %a /var/log/kolla/neutron) != "755" ]]; then
chmod 755 /var/log/kolla/neutron
fi
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases # Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty. # of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then