From ce86de9915d24f3a3dc7688ff66a536b6adb780b Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Thu, 27 Aug 2015 18:30:58 -0700 Subject: [PATCH] Move scripts for neutron to docker_templates Change-Id: Ife6623aab20c4259af28d2b1374fc838b934d053 Partially-Implements: blueprint remove-docker-dir --- .../binary/neutron/neutron-base/ip_wrapper.py | 1 - .../source/neutron/neutron-base/ip_wrapper.py | 1 - .../neutron/neutron-agents/supervisord.conf | 40 ----------- .../neutron/neutron-base/config-sudoers.sh | 12 ---- .../common/neutron/neutron-base/ip_wrapper.py | 66 ------------------ .../neutron-dhcp-agent/config-external.sh | 13 ---- .../neutron/neutron-dhcp-agent/start.sh | 37 ---------- .../neutron-l3-agent/config-external.sh | 23 ------- .../neutron/neutron-l3-agent/fwaas_driver.ini | 3 - .../common/neutron/neutron-l3-agent/start.sh | 37 ---------- .../config-external.sh | 20 ------ .../neutron-linuxbridge-agent/start.sh | 14 ---- .../neutron-metadata-agent/config-external.sh | 13 ---- .../neutron/neutron-metadata-agent/start.sh | 37 ---------- .../config-external.sh | 20 ------ .../neutron-openvswitch-agent/start.sh | 14 ---- .../neutron/neutron-server/config-external.sh | 20 ------ docker/common/neutron/neutron-server/start.sh | 20 ------ .../neutron/neutron-agents/fwaas_driver.ini | 2 +- .../neutron-dhcp-agent/config-external.sh | 14 +++- .../neutron-dhcp-agent/start.sh | 38 ++++++++++- .../neutron-l3-agent/config-external.sh | 24 ++++++- .../neutron-l3-agent/fwaas_driver.ini | 4 +- .../neutron-agents/neutron-l3-agent/start.sh | 38 ++++++++++- .../neutron-metadata-agent/config-external.sh | 14 +++- .../neutron-metadata-agent/start.sh | 38 ++++++++++- .../neutron/neutron-agents/supervisord.conf | 41 +++++++++++- .../neutron/neutron-base/config-sudoers.sh | 13 +++- .../neutron/neutron-base/ip_wrapper.py | 67 ++++++++++++++++++- .../config-external.sh | 21 +++++- .../neutron-linuxbridge-agent/start.sh | 15 ++++- .../config-external.sh | 21 +++++- .../neutron-openvswitch-agent/start.sh | 15 ++++- .../neutron/neutron-server/config-external.sh | 21 +++++- .../neutron/neutron-server/start.sh | 21 +++++- 35 files changed, 390 insertions(+), 408 deletions(-) delete mode 120000 docker/centos/binary/neutron/neutron-base/ip_wrapper.py delete mode 120000 docker/centos/source/neutron/neutron-base/ip_wrapper.py delete mode 100644 docker/common/neutron/neutron-agents/supervisord.conf delete mode 100644 docker/common/neutron/neutron-base/config-sudoers.sh delete mode 100755 docker/common/neutron/neutron-base/ip_wrapper.py delete mode 100755 docker/common/neutron/neutron-dhcp-agent/config-external.sh delete mode 100755 docker/common/neutron/neutron-dhcp-agent/start.sh delete mode 100755 docker/common/neutron/neutron-l3-agent/config-external.sh delete mode 100644 docker/common/neutron/neutron-l3-agent/fwaas_driver.ini delete mode 100755 docker/common/neutron/neutron-l3-agent/start.sh delete mode 100755 docker/common/neutron/neutron-linuxbridge-agent/config-external.sh delete mode 100755 docker/common/neutron/neutron-linuxbridge-agent/start.sh delete mode 100755 docker/common/neutron/neutron-metadata-agent/config-external.sh delete mode 100755 docker/common/neutron/neutron-metadata-agent/start.sh delete mode 100755 docker/common/neutron/neutron-openvswitch-agent/config-external.sh delete mode 100755 docker/common/neutron/neutron-openvswitch-agent/start.sh delete mode 100755 docker/common/neutron/neutron-server/config-external.sh delete mode 100755 docker/common/neutron/neutron-server/start.sh mode change 120000 => 100755 docker_templates/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh mode change 120000 => 100755 docker_templates/neutron/neutron-agents/neutron-dhcp-agent/start.sh mode change 120000 => 100755 docker_templates/neutron/neutron-agents/neutron-l3-agent/config-external.sh mode change 120000 => 100644 docker_templates/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini mode change 120000 => 100755 docker_templates/neutron/neutron-agents/neutron-l3-agent/start.sh mode change 120000 => 100755 docker_templates/neutron/neutron-agents/neutron-metadata-agent/config-external.sh mode change 120000 => 100755 docker_templates/neutron/neutron-agents/neutron-metadata-agent/start.sh mode change 120000 => 100644 docker_templates/neutron/neutron-agents/supervisord.conf mode change 120000 => 100644 docker_templates/neutron/neutron-base/config-sudoers.sh mode change 120000 => 100755 docker_templates/neutron/neutron-base/ip_wrapper.py mode change 120000 => 100755 docker_templates/neutron/neutron-linuxbridge-agent/config-external.sh mode change 120000 => 100755 docker_templates/neutron/neutron-linuxbridge-agent/start.sh mode change 120000 => 100755 docker_templates/neutron/neutron-openvswitch-agent/config-external.sh mode change 120000 => 100755 docker_templates/neutron/neutron-openvswitch-agent/start.sh mode change 120000 => 100755 docker_templates/neutron/neutron-server/config-external.sh mode change 120000 => 100755 docker_templates/neutron/neutron-server/start.sh diff --git a/docker/centos/binary/neutron/neutron-base/ip_wrapper.py b/docker/centos/binary/neutron/neutron-base/ip_wrapper.py deleted file mode 120000 index 10607150ab..0000000000 --- a/docker/centos/binary/neutron/neutron-base/ip_wrapper.py +++ /dev/null @@ -1 +0,0 @@ -../../../../common/neutron/neutron-base/ip_wrapper.py \ No newline at end of file diff --git a/docker/centos/source/neutron/neutron-base/ip_wrapper.py b/docker/centos/source/neutron/neutron-base/ip_wrapper.py deleted file mode 120000 index 10607150ab..0000000000 --- a/docker/centos/source/neutron/neutron-base/ip_wrapper.py +++ /dev/null @@ -1 +0,0 @@ -../../../../common/neutron/neutron-base/ip_wrapper.py \ No newline at end of file diff --git a/docker/common/neutron/neutron-agents/supervisord.conf b/docker/common/neutron/neutron-agents/supervisord.conf deleted file mode 100644 index 5cab8f5dcd..0000000000 --- a/docker/common/neutron/neutron-agents/supervisord.conf +++ /dev/null @@ -1,40 +0,0 @@ -[unix_http_server] -file = /var/run/supervisor.sock - -[inet_http_server] -port = 127.0.0.1:9001 - -[supervisord] -nodaemon=true -logfile = /var/log/supervisor/supervisord.log -logfile_maxbytes = 200KB -logfile_backups = 1 -pidfile = /var/run/supervisord.pid -childlogdir = /var/log/supervisor - -[rpcinterface:supervisor] -supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface - -[supervisorctl] -serverurl = unix:///var/run/supervisor.sock - -[program:neutron-dhcp-agent] -command=/opt/kolla/neutron-dhcp-agent/start.sh -priority=40 -startsec=10 -stderr_events_enabled=true -stdout_events_enabled=true - -[program:neutron-metadata-agent] -command=/opt/kolla/neutron-metadata-agent/start.sh -priority=40 -startsec=10 -stderr_events_enabled=true -stdout_events_enabled=true - -[program:neutron-l3-agent] -command=/opt/kolla/neutron-l3-agent/start.sh -priority=40 -startsec=10 -stderr_events_enabled=true -stdout_events_enabled=true diff --git a/docker/common/neutron/neutron-base/config-sudoers.sh b/docker/common/neutron/neutron-base/config-sudoers.sh deleted file mode 100644 index 82cf0d6246..0000000000 --- a/docker/common/neutron/neutron-base/config-sudoers.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# Neutron uses rootwrap which requires a tty for sudo. -# Since the container is running in daemon mode, a tty -# is not present and requiretty must be commented out. -if [ ! -f /sudo-modified ]; then - chmod 0640 /etc/sudoers - sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers - chmod 0440 /etc/sudoers -fi - -touch /sudo-modified diff --git a/docker/common/neutron/neutron-base/ip_wrapper.py b/docker/common/neutron/neutron-base/ip_wrapper.py deleted file mode 100755 index 591fca6f4b..0000000000 --- a/docker/common/neutron/neutron-base/ip_wrapper.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2015 Sam Yaple -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This file exists because we want to create and delete any network -# namespaces from the host mount namespace. This allows the host to -# access all of the neutron network namespaces as well as all -# containers that bind mount /run/netns from the host. - -# This is required for "thin" neutron containers to function properly - -import nsenter -import subprocess -import sys - - -def host_mnt_exec(cmd): - try: - with nsenter.ExitStack() as stack: - stack.enter_context( - nsenter.Namespace( - '1', - 'mnt', - proc='/opt/kolla/host_proc/')) - process_ = subprocess.Popen(cmd) - - except Exception as e: - print( - "An error has occured with a component that Kolla manages." - " Please file a bug") - print("Error: ", e) - - return process_ - - -if len(sys.argv) > 2: - # We catch all commands that ip will accept that refer - # to creating or deleteing a Network namespace - if str(sys.argv[1]).startswith("net") and ( - str(sys.argv[2]).startswith("a") or - str(sys.argv[2]).startswith("d")): - # This cmd is executed in the host mount namespace - cmd = ["/usr/bin/env", "ip"] + sys.argv[1:] - sys.exit(host_mnt_exec(cmd).returncode) - else: - cmd = ["/opt/kolla/ip"] + sys.argv[1:] -else: - cmd = ["/opt/kolla/ip"] - - if len(sys.argv) == 2: - cmd = cmd + sys.argv[1:] - -process_ = subprocess.Popen(cmd) -sys.exit(process_.returncode) diff --git a/docker/common/neutron/neutron-dhcp-agent/config-external.sh b/docker/common/neutron/neutron-dhcp-agent/config-external.sh deleted file mode 100755 index badbd86a10..0000000000 --- a/docker/common/neutron/neutron-dhcp-agent/config-external.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/dhcp_agent.ini /opt/kolla/neutron-agents/dnsmasq.conf" -TARGET="/etc/neutron/" -OWNER="neutron" - -for f in $SOURCES; do - if [[ -f "$f" ]]; then - fname=$(basename $f) - cp $f $TARGET - chown ${OWNER}: $TARGET/$fname - chmod 0644 $TARGET/$fname - fi -done diff --git a/docker/common/neutron/neutron-dhcp-agent/start.sh b/docker/common/neutron/neutron-dhcp-agent/start.sh deleted file mode 100755 index 9186a5c90d..0000000000 --- a/docker/common/neutron/neutron-dhcp-agent/start.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -set -o errexit - -CMD="/usr/bin/neutron-dhcp-agent" -ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini" - -# Loading common functions. -source /opt/kolla/kolla-common.sh -source /opt/kolla/config-sudoers.sh - -# Override set_configs() here because it doesn't work for fat containers like -# this one. -set_configs() { - case $KOLLA_CONFIG_STRATEGY in - COPY_ALWAYS) - source /opt/kolla/neutron-dhcp-agent/config-external.sh - ;; - COPY_ONCE) - if [[ -f /configured-dhcp ]]; then - echo 'INFO - Neutron-dhcp has already been configured; Refusing to copy new configs' - return - fi - source /opt/kolla/neutron-dhcp-agent/config-external.sh - touch /configured-dhcp - ;; - - *) - echo '$KOLLA_CONFIG_STRATEGY is not set properly' - exit 1 - ;; - esac -} - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/neutron/neutron-l3-agent/config-external.sh b/docker/common/neutron/neutron-l3-agent/config-external.sh deleted file mode 100755 index e6eb049a4b..0000000000 --- a/docker/common/neutron/neutron-l3-agent/config-external.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/l3_agent.ini /opt/kolla/neutron-agents/fwaas_driver.ini" -TARGET="/etc/neutron/" -OWNER="neutron" - -for f in $SOURCES; do - if [[ -f "$f" ]]; then - fname=$(basename $f) - cp $f $TARGET - chown ${OWNER}: $TARGET/$fname - chmod 0644 $TARGET/$fname - fi -done - -SOURCE="/opt/kolla/neutron-agents/ml2_conf.ini" -TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" -OWNER="neutron" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0644 $TARGET -fi diff --git a/docker/common/neutron/neutron-l3-agent/fwaas_driver.ini b/docker/common/neutron/neutron-l3-agent/fwaas_driver.ini deleted file mode 100644 index 41f761abf1..0000000000 --- a/docker/common/neutron/neutron-l3-agent/fwaas_driver.ini +++ /dev/null @@ -1,3 +0,0 @@ -[fwaas] -#driver = neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver -#enabled = True diff --git a/docker/common/neutron/neutron-l3-agent/start.sh b/docker/common/neutron/neutron-l3-agent/start.sh deleted file mode 100755 index 2a0f18b62c..0000000000 --- a/docker/common/neutron/neutron-l3-agent/start.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -set -o errexit - -CMD="/usr/bin/neutron-l3-agent" -ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" - -# Loading common functions. -source /opt/kolla/kolla-common.sh -source /opt/kolla/config-sudoers.sh - -# Override set_configs() here because it doesn't work for fat containers like -# this one. -set_configs() { - case $KOLLA_CONFIG_STRATEGY in - COPY_ALWAYS) - source /opt/kolla/neutron-l3-agent/config-external.sh - ;; - COPY_ONCE) - if [[ -f /configured-l3 ]]; then - echo 'INFO - Neutron-l3 has already been configured; Refusing to copy new configs' - return - fi - source /opt/kolla/neutron-l3-agent/config-external.sh - touch /configured-l3 - ;; - - *) - echo '$KOLLA_CONFIG_STRATEGY is not set properly' - exit 1 - ;; - esac -} - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/neutron/neutron-linuxbridge-agent/config-external.sh b/docker/common/neutron/neutron-linuxbridge-agent/config-external.sh deleted file mode 100755 index c44d71d84d..0000000000 --- a/docker/common/neutron/neutron-linuxbridge-agent/config-external.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -SOURCE="/opt/kolla/neutron-linuxbridge-agent/neutron.conf" -TARGET="/etc/neutron/neutron.conf" -OWNER="neutron" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0644 $TARGET -fi - -SOURCE="/opt/kolla/neutron-linuxbridge-agent/ml2_conf.ini" -TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" -OWNER="neutron" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0644 $TARGET -fi diff --git a/docker/common/neutron/neutron-linuxbridge-agent/start.sh b/docker/common/neutron/neutron-linuxbridge-agent/start.sh deleted file mode 100755 index ab47f2dfb1..0000000000 --- a/docker/common/neutron/neutron-linuxbridge-agent/start.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -o errexit - -CMD="/usr/bin/neutron-linuxbridge-agent" -ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" - -# Loading common functions. -source /opt/kolla/kolla-common.sh -source /opt/kolla/config-sudoers.sh - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/neutron/neutron-metadata-agent/config-external.sh b/docker/common/neutron/neutron-metadata-agent/config-external.sh deleted file mode 100755 index 319ee3793c..0000000000 --- a/docker/common/neutron/neutron-metadata-agent/config-external.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/metadata_agent.ini" -TARGET="/etc/neutron/" -OWNER="neutron" - -for f in $SOURCES; do - if [[ -f "$f" ]]; then - fname=$(basename $f) - cp $f $TARGET - chown ${OWNER}: $TARGET/$fname - chmod 0644 $TARGET/$fname - fi -done diff --git a/docker/common/neutron/neutron-metadata-agent/start.sh b/docker/common/neutron/neutron-metadata-agent/start.sh deleted file mode 100755 index 04c37159af..0000000000 --- a/docker/common/neutron/neutron-metadata-agent/start.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -set -o errexit - -CMD="/usr/bin/neutron-metadata-agent" -ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini" - -# Loading common functions. -source /opt/kolla/kolla-common.sh -source /opt/kolla/config-sudoers.sh - -# Override set_configs() here because it doesn't work for fat containers like -# this one. -set_configs() { - case $KOLLA_CONFIG_STRATEGY in - COPY_ALWAYS) - source /opt/kolla/neutron-metadata-agent/config-external.sh - ;; - COPY_ONCE) - if [[ -f /configured-md ]]; then - echo 'INFO - Neutron-metadata has already been configured; Refusing to copy new configs' - return - fi - source /opt/kolla/neutron-metadata-agent/config-external.sh - touch /configured-md - ;; - - *) - echo '$KOLLA_CONFIG_STRATEGY is not set properly' - exit 1 - ;; - esac -} - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/neutron/neutron-openvswitch-agent/config-external.sh b/docker/common/neutron/neutron-openvswitch-agent/config-external.sh deleted file mode 100755 index 552d698617..0000000000 --- a/docker/common/neutron/neutron-openvswitch-agent/config-external.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -SOURCE="/opt/kolla/neutron-openvswitch-agent/neutron.conf" -TARGET="/etc/neutron/neutron.conf" -OWNER="neutron" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0644 $TARGET -fi - -SOURCE="/opt/kolla/neutron-openvswitch-agent/ml2_conf.ini" -TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" -OWNER="neutron" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0644 $TARGET -fi diff --git a/docker/common/neutron/neutron-openvswitch-agent/start.sh b/docker/common/neutron/neutron-openvswitch-agent/start.sh deleted file mode 100755 index 6d62ff65d5..0000000000 --- a/docker/common/neutron/neutron-openvswitch-agent/start.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -o errexit - -CMD="/usr/bin/neutron-openvswitch-agent" -ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" - -# Loading common functions. -source /opt/kolla/kolla-common.sh -source /opt/kolla/config-sudoers.sh - -# Execute config strategy -set_configs - -exec $CMD $ARGS diff --git a/docker/common/neutron/neutron-server/config-external.sh b/docker/common/neutron/neutron-server/config-external.sh deleted file mode 100755 index 574923067f..0000000000 --- a/docker/common/neutron/neutron-server/config-external.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -SOURCE="/opt/kolla/neutron-server/neutron.conf" -TARGET="/etc/neutron/neutron.conf" -OWNER="neutron" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0644 $TARGET -fi - -SOURCE="/opt/kolla/neutron-server/ml2_conf.ini" -TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" -OWNER="neutron" - -if [[ -f "$SOURCE" ]]; then - cp $SOURCE $TARGET - chown ${OWNER}: $TARGET - chmod 0644 $TARGET -fi diff --git a/docker/common/neutron/neutron-server/start.sh b/docker/common/neutron/neutron-server/start.sh deleted file mode 100755 index 51c4c2a3dc..0000000000 --- a/docker/common/neutron/neutron-server/start.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -o errexit - -CMD="/usr/bin/neutron-server" -ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" - -# Loading common functions. -source /opt/kolla/kolla-common.sh - -# Execute config strategy -set_configs - -# 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 - su -s /bin/bash -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron - exit 0 -fi - -exec $CMD $ARGS diff --git a/docker_templates/neutron/neutron-agents/fwaas_driver.ini b/docker_templates/neutron/neutron-agents/fwaas_driver.ini index 1cee84b371..a9b1ec519d 120000 --- a/docker_templates/neutron/neutron-agents/fwaas_driver.ini +++ b/docker_templates/neutron/neutron-agents/fwaas_driver.ini @@ -1 +1 @@ -../../../docker/common/neutron/neutron-l3-agent/fwaas_driver.ini \ No newline at end of file +neutron-l3-agent/fwaas_driver.ini \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh b/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh deleted file mode 120000 index 9954a4eb38..0000000000 --- a/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../docker/common/neutron/neutron-dhcp-agent/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh b/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh new file mode 100755 index 0000000000..badbd86a10 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/config-external.sh @@ -0,0 +1,13 @@ +#!/bin/bash +SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/dhcp_agent.ini /opt/kolla/neutron-agents/dnsmasq.conf" +TARGET="/etc/neutron/" +OWNER="neutron" + +for f in $SOURCES; do + if [[ -f "$f" ]]; then + fname=$(basename $f) + cp $f $TARGET + chown ${OWNER}: $TARGET/$fname + chmod 0644 $TARGET/$fname + fi +done diff --git a/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/start.sh b/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/start.sh deleted file mode 120000 index 4679ff75c9..0000000000 --- a/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../docker/common/neutron/neutron-dhcp-agent/start.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/start.sh b/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/start.sh new file mode 100755 index 0000000000..7b64f87aa6 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-dhcp-agent/start.sh @@ -0,0 +1,37 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/neutron-dhcp-agent" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini" + +# Loading common functions. +source /opt/kolla/kolla-common.sh +source /opt/kolla/config-sudoers.sh + +# Override set_configs() here because it doesn't work for fat containers like +# this one. +set_configs() { + case $KOLLA_CONFIG_STRATEGY in + CONFIG_EXTERNAL_COPY_ALWAYS) + source /opt/kolla/neutron-dhcp-agent/config-external.sh + ;; + CONFIG_EXTERNAL_COPY_ONCE) + if [[ -f /configured-dhcp ]]; then + echo 'INFO - Neutron-dhcp has already been configured; Refusing to copy new configs' + return + fi + source /opt/kolla/neutron-dhcp-agent/config-external.sh + touch /configured-dhcp + ;; + + *) + echo '$KOLLA_CONFIG_STRATEGY is not set properly' + exit 1 + ;; + esac +} + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/neutron/neutron-agents/neutron-l3-agent/config-external.sh b/docker_templates/neutron/neutron-agents/neutron-l3-agent/config-external.sh deleted file mode 120000 index 349f755841..0000000000 --- a/docker_templates/neutron/neutron-agents/neutron-l3-agent/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../docker/common/neutron/neutron-l3-agent/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-l3-agent/config-external.sh b/docker_templates/neutron/neutron-agents/neutron-l3-agent/config-external.sh new file mode 100755 index 0000000000..e6eb049a4b --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-l3-agent/config-external.sh @@ -0,0 +1,23 @@ +#!/bin/bash +SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/l3_agent.ini /opt/kolla/neutron-agents/fwaas_driver.ini" +TARGET="/etc/neutron/" +OWNER="neutron" + +for f in $SOURCES; do + if [[ -f "$f" ]]; then + fname=$(basename $f) + cp $f $TARGET + chown ${OWNER}: $TARGET/$fname + chmod 0644 $TARGET/$fname + fi +done + +SOURCE="/opt/kolla/neutron-agents/ml2_conf.ini" +TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" +OWNER="neutron" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker_templates/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini b/docker_templates/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini deleted file mode 120000 index 7e00b3b7fc..0000000000 --- a/docker_templates/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini +++ /dev/null @@ -1 +0,0 @@ -../../../../docker/common/neutron/neutron-l3-agent/fwaas_driver.ini \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini b/docker_templates/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini new file mode 100644 index 0000000000..41f761abf1 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-l3-agent/fwaas_driver.ini @@ -0,0 +1,3 @@ +[fwaas] +#driver = neutron.services.firewall.drivers.linux.iptables_fwaas.IptablesFwaasDriver +#enabled = True diff --git a/docker_templates/neutron/neutron-agents/neutron-l3-agent/start.sh b/docker_templates/neutron/neutron-agents/neutron-l3-agent/start.sh deleted file mode 120000 index 3b2b832d66..0000000000 --- a/docker_templates/neutron/neutron-agents/neutron-l3-agent/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../docker/common/neutron/neutron-l3-agent/start.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-l3-agent/start.sh b/docker_templates/neutron/neutron-agents/neutron-l3-agent/start.sh new file mode 100755 index 0000000000..e0a17e47a6 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-l3-agent/start.sh @@ -0,0 +1,37 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/neutron-l3-agent" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --config-file /etc/neutron/fwaas_driver.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" + +# Loading common functions. +source /opt/kolla/kolla-common.sh +source /opt/kolla/config-sudoers.sh + +# Override set_configs() here because it doesn't work for fat containers like +# this one. +set_configs() { + case $KOLLA_CONFIG_STRATEGY in + CONFIG_EXTERNAL_COPY_ALWAYS) + source /opt/kolla/neutron-l3-agent/config-external.sh + ;; + CONFIG_EXTERNAL_COPY_ONCE) + if [[ -f /configured-l3 ]]; then + echo 'INFO - Neutron-l3 has already been configured; Refusing to copy new configs' + return + fi + source /opt/kolla/neutron-l3-agent/config-external.sh + touch /configured-l3 + ;; + + *) + echo '$KOLLA_CONFIG_STRATEGY is not set properly' + exit 1 + ;; + esac +} + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/neutron/neutron-agents/neutron-metadata-agent/config-external.sh b/docker_templates/neutron/neutron-agents/neutron-metadata-agent/config-external.sh deleted file mode 120000 index eeeb72d51c..0000000000 --- a/docker_templates/neutron/neutron-agents/neutron-metadata-agent/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../docker/common/neutron/neutron-metadata-agent/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-metadata-agent/config-external.sh b/docker_templates/neutron/neutron-agents/neutron-metadata-agent/config-external.sh new file mode 100755 index 0000000000..319ee3793c --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-metadata-agent/config-external.sh @@ -0,0 +1,13 @@ +#!/bin/bash +SOURCES="/opt/kolla/neutron-agents/neutron.conf /opt/kolla/neutron-agents/metadata_agent.ini" +TARGET="/etc/neutron/" +OWNER="neutron" + +for f in $SOURCES; do + if [[ -f "$f" ]]; then + fname=$(basename $f) + cp $f $TARGET + chown ${OWNER}: $TARGET/$fname + chmod 0644 $TARGET/$fname + fi +done diff --git a/docker_templates/neutron/neutron-agents/neutron-metadata-agent/start.sh b/docker_templates/neutron/neutron-agents/neutron-metadata-agent/start.sh deleted file mode 120000 index a484554622..0000000000 --- a/docker_templates/neutron/neutron-agents/neutron-metadata-agent/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../docker/common/neutron/neutron-metadata-agent/start.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/neutron-metadata-agent/start.sh b/docker_templates/neutron/neutron-agents/neutron-metadata-agent/start.sh new file mode 100755 index 0000000000..09a7329c74 --- /dev/null +++ b/docker_templates/neutron/neutron-agents/neutron-metadata-agent/start.sh @@ -0,0 +1,37 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/neutron-metadata-agent" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini" + +# Loading common functions. +source /opt/kolla/kolla-common.sh +source /opt/kolla/config-sudoers.sh + +# Override set_configs() here because it doesn't work for fat containers like +# this one. +set_configs() { + case $KOLLA_CONFIG_STRATEGY in + CONFIG_EXTERNAL_COPY_ALWAYS) + source /opt/kolla/neutron-metadata-agent/config-external.sh + ;; + CONFIG_EXTERNAL_COPY_ONCE) + if [[ -f /configured-md ]]; then + echo 'INFO - Neutron-metadata has already been configured; Refusing to copy new configs' + return + fi + source /opt/kolla/neutron-metadata-agent/config-external.sh + touch /configured-md + ;; + + *) + echo '$KOLLA_CONFIG_STRATEGY is not set properly' + exit 1 + ;; + esac +} + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/neutron/neutron-agents/supervisord.conf b/docker_templates/neutron/neutron-agents/supervisord.conf deleted file mode 120000 index f4d48915db..0000000000 --- a/docker_templates/neutron/neutron-agents/supervisord.conf +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/neutron/neutron-agents/supervisord.conf \ No newline at end of file diff --git a/docker_templates/neutron/neutron-agents/supervisord.conf b/docker_templates/neutron/neutron-agents/supervisord.conf new file mode 100644 index 0000000000..5cab8f5dcd --- /dev/null +++ b/docker_templates/neutron/neutron-agents/supervisord.conf @@ -0,0 +1,40 @@ +[unix_http_server] +file = /var/run/supervisor.sock + +[inet_http_server] +port = 127.0.0.1:9001 + +[supervisord] +nodaemon=true +logfile = /var/log/supervisor/supervisord.log +logfile_maxbytes = 200KB +logfile_backups = 1 +pidfile = /var/run/supervisord.pid +childlogdir = /var/log/supervisor + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl = unix:///var/run/supervisor.sock + +[program:neutron-dhcp-agent] +command=/opt/kolla/neutron-dhcp-agent/start.sh +priority=40 +startsec=10 +stderr_events_enabled=true +stdout_events_enabled=true + +[program:neutron-metadata-agent] +command=/opt/kolla/neutron-metadata-agent/start.sh +priority=40 +startsec=10 +stderr_events_enabled=true +stdout_events_enabled=true + +[program:neutron-l3-agent] +command=/opt/kolla/neutron-l3-agent/start.sh +priority=40 +startsec=10 +stderr_events_enabled=true +stdout_events_enabled=true diff --git a/docker_templates/neutron/neutron-base/config-sudoers.sh b/docker_templates/neutron/neutron-base/config-sudoers.sh deleted file mode 120000 index 02ea80ca77..0000000000 --- a/docker_templates/neutron/neutron-base/config-sudoers.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/neutron/neutron-base/config-sudoers.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-base/config-sudoers.sh b/docker_templates/neutron/neutron-base/config-sudoers.sh new file mode 100644 index 0000000000..82cf0d6246 --- /dev/null +++ b/docker_templates/neutron/neutron-base/config-sudoers.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Neutron uses rootwrap which requires a tty for sudo. +# Since the container is running in daemon mode, a tty +# is not present and requiretty must be commented out. +if [ ! -f /sudo-modified ]; then + chmod 0640 /etc/sudoers + sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers + chmod 0440 /etc/sudoers +fi + +touch /sudo-modified diff --git a/docker_templates/neutron/neutron-base/ip_wrapper.py b/docker_templates/neutron/neutron-base/ip_wrapper.py deleted file mode 120000 index ef59fec526..0000000000 --- a/docker_templates/neutron/neutron-base/ip_wrapper.py +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/neutron/neutron-base/ip_wrapper.py \ No newline at end of file diff --git a/docker_templates/neutron/neutron-base/ip_wrapper.py b/docker_templates/neutron/neutron-base/ip_wrapper.py new file mode 100755 index 0000000000..591fca6f4b --- /dev/null +++ b/docker_templates/neutron/neutron-base/ip_wrapper.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +# Copyright 2015 Sam Yaple +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file exists because we want to create and delete any network +# namespaces from the host mount namespace. This allows the host to +# access all of the neutron network namespaces as well as all +# containers that bind mount /run/netns from the host. + +# This is required for "thin" neutron containers to function properly + +import nsenter +import subprocess +import sys + + +def host_mnt_exec(cmd): + try: + with nsenter.ExitStack() as stack: + stack.enter_context( + nsenter.Namespace( + '1', + 'mnt', + proc='/opt/kolla/host_proc/')) + process_ = subprocess.Popen(cmd) + + except Exception as e: + print( + "An error has occured with a component that Kolla manages." + " Please file a bug") + print("Error: ", e) + + return process_ + + +if len(sys.argv) > 2: + # We catch all commands that ip will accept that refer + # to creating or deleteing a Network namespace + if str(sys.argv[1]).startswith("net") and ( + str(sys.argv[2]).startswith("a") or + str(sys.argv[2]).startswith("d")): + # This cmd is executed in the host mount namespace + cmd = ["/usr/bin/env", "ip"] + sys.argv[1:] + sys.exit(host_mnt_exec(cmd).returncode) + else: + cmd = ["/opt/kolla/ip"] + sys.argv[1:] +else: + cmd = ["/opt/kolla/ip"] + + if len(sys.argv) == 2: + cmd = cmd + sys.argv[1:] + +process_ = subprocess.Popen(cmd) +sys.exit(process_.returncode) diff --git a/docker_templates/neutron/neutron-linuxbridge-agent/config-external.sh b/docker_templates/neutron/neutron-linuxbridge-agent/config-external.sh deleted file mode 120000 index 1cf0fcc794..0000000000 --- a/docker_templates/neutron/neutron-linuxbridge-agent/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/neutron/neutron-linuxbridge-agent/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-linuxbridge-agent/config-external.sh b/docker_templates/neutron/neutron-linuxbridge-agent/config-external.sh new file mode 100755 index 0000000000..c44d71d84d --- /dev/null +++ b/docker_templates/neutron/neutron-linuxbridge-agent/config-external.sh @@ -0,0 +1,20 @@ +#!/bin/bash +SOURCE="/opt/kolla/neutron-linuxbridge-agent/neutron.conf" +TARGET="/etc/neutron/neutron.conf" +OWNER="neutron" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi + +SOURCE="/opt/kolla/neutron-linuxbridge-agent/ml2_conf.ini" +TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" +OWNER="neutron" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker_templates/neutron/neutron-linuxbridge-agent/start.sh b/docker_templates/neutron/neutron-linuxbridge-agent/start.sh deleted file mode 120000 index ed241551eb..0000000000 --- a/docker_templates/neutron/neutron-linuxbridge-agent/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/neutron/neutron-linuxbridge-agent/start.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-linuxbridge-agent/start.sh b/docker_templates/neutron/neutron-linuxbridge-agent/start.sh new file mode 100755 index 0000000000..ab47f2dfb1 --- /dev/null +++ b/docker_templates/neutron/neutron-linuxbridge-agent/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/neutron-linuxbridge-agent" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" + +# Loading common functions. +source /opt/kolla/kolla-common.sh +source /opt/kolla/config-sudoers.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/neutron/neutron-openvswitch-agent/config-external.sh b/docker_templates/neutron/neutron-openvswitch-agent/config-external.sh deleted file mode 120000 index 5b561db092..0000000000 --- a/docker_templates/neutron/neutron-openvswitch-agent/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/neutron/neutron-openvswitch-agent/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-openvswitch-agent/config-external.sh b/docker_templates/neutron/neutron-openvswitch-agent/config-external.sh new file mode 100755 index 0000000000..552d698617 --- /dev/null +++ b/docker_templates/neutron/neutron-openvswitch-agent/config-external.sh @@ -0,0 +1,20 @@ +#!/bin/bash +SOURCE="/opt/kolla/neutron-openvswitch-agent/neutron.conf" +TARGET="/etc/neutron/neutron.conf" +OWNER="neutron" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi + +SOURCE="/opt/kolla/neutron-openvswitch-agent/ml2_conf.ini" +TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" +OWNER="neutron" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker_templates/neutron/neutron-openvswitch-agent/start.sh b/docker_templates/neutron/neutron-openvswitch-agent/start.sh deleted file mode 120000 index 5a8cdc1eea..0000000000 --- a/docker_templates/neutron/neutron-openvswitch-agent/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/neutron/neutron-openvswitch-agent/start.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-openvswitch-agent/start.sh b/docker_templates/neutron/neutron-openvswitch-agent/start.sh new file mode 100755 index 0000000000..6d62ff65d5 --- /dev/null +++ b/docker_templates/neutron/neutron-openvswitch-agent/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/neutron-openvswitch-agent" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" + +# Loading common functions. +source /opt/kolla/kolla-common.sh +source /opt/kolla/config-sudoers.sh + +# Execute config strategy +set_configs + +exec $CMD $ARGS diff --git a/docker_templates/neutron/neutron-server/config-external.sh b/docker_templates/neutron/neutron-server/config-external.sh deleted file mode 120000 index b10058e78b..0000000000 --- a/docker_templates/neutron/neutron-server/config-external.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/neutron/neutron-server/config-external.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-server/config-external.sh b/docker_templates/neutron/neutron-server/config-external.sh new file mode 100755 index 0000000000..574923067f --- /dev/null +++ b/docker_templates/neutron/neutron-server/config-external.sh @@ -0,0 +1,20 @@ +#!/bin/bash +SOURCE="/opt/kolla/neutron-server/neutron.conf" +TARGET="/etc/neutron/neutron.conf" +OWNER="neutron" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi + +SOURCE="/opt/kolla/neutron-server/ml2_conf.ini" +TARGET="/etc/neutron/plugins/ml2/ml2_conf.ini" +OWNER="neutron" + +if [[ -f "$SOURCE" ]]; then + cp $SOURCE $TARGET + chown ${OWNER}: $TARGET + chmod 0644 $TARGET +fi diff --git a/docker_templates/neutron/neutron-server/start.sh b/docker_templates/neutron/neutron-server/start.sh deleted file mode 120000 index 389786a964..0000000000 --- a/docker_templates/neutron/neutron-server/start.sh +++ /dev/null @@ -1 +0,0 @@ -../../../docker/common/neutron/neutron-server/start.sh \ No newline at end of file diff --git a/docker_templates/neutron/neutron-server/start.sh b/docker_templates/neutron/neutron-server/start.sh new file mode 100755 index 0000000000..51c4c2a3dc --- /dev/null +++ b/docker_templates/neutron/neutron-server/start.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -o errexit + +CMD="/usr/bin/neutron-server" +ARGS="--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini" + +# Loading common functions. +source /opt/kolla/kolla-common.sh + +# Execute config strategy +set_configs + +# 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 + su -s /bin/bash -c "neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head" neutron + exit 0 +fi + +exec $CMD $ARGS