From 792e3d5cd79c76c912ace410a17fa45275f4a439 Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Tue, 28 Apr 2015 15:30:37 +0000 Subject: openstack: improve network configuration extension Also ensure that the /etc/openstack directory exists. Change-Id: I633cf3e9add94ff1d9622062e55b4d15db541cbf --- openstack-network.configure | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/openstack-network.configure b/openstack-network.configure index a4d43a6a..10be5a1c 100644 --- a/openstack-network.configure +++ b/openstack-network.configure @@ -18,13 +18,26 @@ set -e ROOT="$1" -ln -sf "/usr/lib/systemd/system/openvswitch-setup.service" \ - "$ROOT/etc/systemd/system/multi-user.target.wants/openvswitch-setup.service" +enable(){ + ln -sf "/usr/lib/systemd/system/$1.service" \ + "$ROOT/etc/systemd/system/multi-user.target.wants/$1.service" +} -ln -sf "/usr/lib/systemd/system/openstack-network-setup.service" \ - "$ROOT/etc/systemd/system/multi-user.target.wants/openstack-network-setup.service" +################### +# Enable services # +################### -python <<'EOF' >"$ROOT/etc/openstack/network.conf" +enable openvswitch-setup +enable openstack-network-setup + +########################################################################## +# Generate config variable shell snippet +########################################################################## + +OPENSTACK_DATA="$ROOT/etc/openstack" +mkdir -p "$OPENSTACK_DATA" + +python <<'EOF' >"$OPENSTACK_DATA/network.conf" import os, sys, yaml network_configuration = {} -- cgit v1.2.1