Add ODL_NAME variable for OpenDaylight configuration
This makes the name of the unzipped package configurable so you can run
with releases other than the default specified in lib/opendaylight.
Change-Id: Iad879c558d742da03375cb61b0c2ef141573ffec
diff --git a/lib/opendaylight b/lib/opendaylight
index 374de95..bdebe58 100644
--- a/lib/opendaylight
+++ b/lib/opendaylight
@@ -44,6 +44,9 @@
# The ODL password
ODL_PASSWORD=${ODL_PASSWORD:-admin}
+# Short name of ODL package
+ODL_NAME=${ODL_NAME:-distribution-karaf-0.2.0-Helium}
+
# <define global variables here that belong to this project>
ODL_DIR=$DEST/opendaylight
@@ -87,23 +90,23 @@
# configure_opendaylight() - Set config files, create data dirs, etc
function configure_opendaylight {
# Add odl-ovsdb-openstack if it's not already there
- local ODLOVSDB=$(cat $ODL_DIR/distribution-karaf-0.2.0-Helium/etc/org.apache.karaf.features.cfg | grep featuresBoot= | grep odl)
+ local ODLOVSDB=$(cat $ODL_DIR/$ODL_NAME/etc/org.apache.karaf.features.cfg | grep featuresBoot= | grep odl)
if [ "$ODLOVSDB" == "" ]; then
- sed -i '/^featuresBoot=/ s/$/,odl-ovsdb-openstack/' $ODL_DIR/distribution-karaf-0.2.0-Helium/etc/org.apache.karaf.features.cfg
+ sed -i '/^featuresBoot=/ s/$/,odl-ovsdb-openstack/' $ODL_DIR/$ODL_NAME/etc/org.apache.karaf.features.cfg
fi
# Configure OpenFlow 1.3 if it's not there
- local OFLOW13=$(cat $ODL_DIR/distribution-karaf-0.2.0-Helium/etc/custom.properties | grep ^of.version)
+ local OFLOW13=$(cat $ODL_DIR/$ODL_NAME/etc/custom.properties | grep ^of.version)
if [ "$OFLOW13" == "" ]; then
- echo "ovsdb.of.version=1.3" >> $ODL_DIR/distribution-karaf-0.2.0-Helium/etc/custom.properties
+ echo "ovsdb.of.version=1.3" >> $ODL_DIR/$ODL_NAME/etc/custom.properties
fi
# Configure L3 if the user wants it
if [ "${ODL_L3}" == "True" ]; then
# Configure L3 FWD if it's not there
- local L3FWD=$(cat $ODL_DIR/distribution-karaf-0.2.0-Helium/etc/custom.properties | grep ^ovsdb.l3.fwd.enabled)
+ local L3FWD=$(cat $ODL_DIR/$ODL_NAME/etc/custom.properties | grep ^ovsdb.l3.fwd.enabled)
if [ "$L3FWD" == "" ]; then
- echo "ovsdb.l3.fwd.enabled=yes" >> $ODL_DIR/distribution-karaf-0.2.0-Helium/etc/custom.properties
+ echo "ovsdb.l3.fwd.enabled=yes" >> $ODL_DIR/$ODL_NAME/etc/custom.properties
fi
fi
}
@@ -156,7 +159,7 @@
# -of13: runs ODL using OpenFlow 1.3 protocol support.
# -virt ovsdb: Runs ODL in "virtualization" mode with OVSDB support
- run_process odl-server "cd $ODL_DIR/distribution-karaf-0.2.0-Helium && JAVA_HOME=$JHOME bin/karaf"
+ run_process odl-server "cd $ODL_DIR/$ODL_NAME && JAVA_HOME=$JHOME bin/karaf"
# Sleep a bit to let OpenDaylight finish starting up
sleep $ODL_BOOT_WAIT