Remove duplicate code in nova extend_start.sh

Change-Id: I37d737509bc7cf3dc74bb13ecb0a6ae68080556e
Partial-Bug: #1546944
This commit is contained in:
Éric Lemoine 2016-02-22 14:32:31 +01:00
parent 33fd50e603
commit ede53b1dcb
8 changed files with 12 additions and 30 deletions

View File

@ -17,8 +17,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_nova_extend_start
RUN chmod 755 /usr/local/bin/kolla_nova_extend_start
{{ include_footer }}

View File

@ -1,12 +1,5 @@
#!/bin/bash
if [[ ! -d "/var/log/kolla/nova" ]]; then
mkdir -p /var/log/kolla/nova
fi
if [[ $(stat -c %a /var/log/kolla/nova) != "755" ]]; then
chmod 755 /var/log/kolla/nova
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

View File

@ -56,6 +56,8 @@ RUN chmod 750 /etc/sudoers.d \
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
RUN touch /usr/local/bin/kolla_nova_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_nova_extend_start
RUN usermod -a -G kolla nova

View File

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

View File

@ -52,8 +52,8 @@ RUN /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements
{% endif %}
COPY nova_compute_sudoers /etc/sudoers.d/nova_compute_sudoers
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_nova_extend_start
RUN chmod 755 /usr/local/bin/kolla_nova_extend_start \
&& chmod 750 /etc/sudoers.d \
&& chmod 440 /etc/sudoers.d/nova_compute_sudoers \
&& rm -f /etc/machine-id

View File

@ -1,13 +1,5 @@
#!/bin/bash
if [[ ! -d "/var/log/kolla/nova" ]]; then
mkdir -p /var/log/kolla/nova
fi
if [[ $(stat -c %a /var/log/kolla/nova) != "755" ]]; then
chmod 755 /var/log/kolla/nova
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

View File

@ -30,8 +30,8 @@ RUN apt-get install -y --no-install-recommends \
{% 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_nova_extend_start
RUN chmod 755 /usr/local/bin/kolla_nova_extend_start \
&& useradd --user-group nova
{{ include_footer }}
{{ include_footer }}

View File

@ -12,10 +12,3 @@ fi
if [[ $(lsmod | grep xenfs) ]]; then
mount -t xenfs xenfs /proc/xen
fi
if [[ ! -d "/var/log/kolla/nova" ]]; then
mkdir -p /var/log/kolla/nova
fi
if [[ $(stat -c %a /var/log/kolla/nova) != "755" ]]; then
chmod 755 /var/log/kolla/nova
fi