From 04001fb66f56eaa0354e1169e2e836aa58157266 Mon Sep 17 00:00:00 2001 From: shutingm Date: Tue, 22 Jan 2019 21:09:15 -0800 Subject: [PATCH] Devstack: Fix failed of ml2 directory creation In the install phase there is no neutron/plugin directory, needs to create it with the right ownership, and use '-p' to create the rest of the path. Improve patch:https://review.openstack.org/#/c/631963/ Change-Id: Ib68d248ca166369e2d63605a04de0266bda9a226 --- devstack/plugin.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index b40408d705..9b1ec4d300 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -130,12 +130,18 @@ elif [[ $Q_PLUGIN == 'vmware_nsx_p' ]]; then fi fi -if [[ "$1" == "stack" && "$2" == "install" ]]; then +if [[ "$1" == "stack" && ("$2" == "install" || "$2" == "post-config") ]]; then if is_service_enabled q-fwaas-v2; then # make sure ml2 config exists for FWaaS-v2 if [ ! -f "/etc/neutron/plugins/ml2/ml2_conf.ini" ]; then - mkdir /etc/neutron/plugins/ml2 - cp $DEST/neutron/etc/neutron/plugins/ml2/ml2_conf.ini.sample /etc/neutron/plugins/ml2/ml2_conf.ini + if [ -f "$DEST/neutron/etc/neutron/plugins/ml2/ml2_conf.ini.sample" ]; then + if [[ ! -f "/etc/neutron" ]]; then + # Create /etc/neutron with the right ownership + sudo install -d -o $STACK_USER $NEUTRON_CONF_DIR + fi + mkdir -p /etc/neutron/plugins/ml2 + cp $DEST/neutron/etc/neutron/plugins/ml2/ml2_conf.ini.sample /etc/neutron/plugins/ml2/ml2_conf.ini + fi fi fi fi