Skip to content

Commit

Permalink
feat(install): add devstack scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ppoffice committed Apr 30, 2018
1 parent a533f2c commit 22d3705
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 2 deletions.
14 changes: 13 additions & 1 deletion README.md
@@ -1,4 +1,7 @@
## Installation & Start

### Manual

```shell
sudo pip install -e .
sudo cp etc/isoflat.ini /etc/neutron/isoflat.ini
Expand All @@ -13,4 +16,13 @@ sudo neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/n
```ini
[ml2_type_flat]
flat_networks =
```
```

### DevStack

A `local.conf` recipe to enable isoflat:

[[local|localrc]]
enable_plugin isoflat https://github.com/ppoffice/isoflat
enable_service isoflat
ISOFLAT_SERVICE_DRIVER=ISOFLAT:ISOFLAT:neutron_isoflat.services.isoflat.service_drivers.isoflat_rpc.IsoflatRpcDriver:default
10 changes: 10 additions & 0 deletions devstack/README.md
@@ -0,0 +1,10 @@
========================
DevStack external plugin
========================

A `local.conf` recipe to enable isoflat:

[[local|localrc]]
enable_plugin isoflat https://github.com/ppoffice/isoflat
enable_service isoflat
ISOFLAT_SERVICE_DRIVER=ISOFLAT:ISOFLAT:neutron_isoflat.services.isoflat.service_drivers.isoflat_rpc.IsoflatRpcDriver:default
53 changes: 53 additions & 0 deletions devstack/plugin.sh
@@ -0,0 +1,53 @@
#!/bin/bash

function install_isoflat {
pip_install --no-deps --editable $ISOFLAT_PLUGIN_PATH
}

function configure_isoflat_plugin {
cp $ISOFLAT_PLUGIN_PATH/etc/isoflat.ini $ISOFLAT_PLUGIN_CONF_FILE
neutron_server_config_add $ISOFLAT_PLUGIN_CONF_FILE
neutron_service_plugin_class_add isoflat
}

if is_service_enabled isoflat; then
if [[ "$1" == "stack" ]]; then
if [[ "$2" == "pre-install" ]]; then
:
elif [[ "$2" == "install" ]]; then
install_isoflat
elif [[ "$2" == "post-config" ]]; then
configure_isoflat_plugin
neutron-db-manage --subproject isoflat upgrade head
echo "Configuring isoflat"
if [ "$ISOFLAT_SERVICE_DRIVER" ]; then
inicomment $ISOFLAT_PLUGIN_CONF_FILE service_providers service_provider
iniadd $ISOFLAT_PLUGIN_CONF_FILE service_providers service_provider $ISOFLAT_SERVICE_DRIVER
fi
elif [[ "$2" == "extra" ]]; then
:
fi
elif [[ "$1" == "unstack" ]]; then
:
fi
fi

if is_service_enabled q-agt neutron-agent; then
if [[ "$1" == "stack" ]]; then
if [[ "$2" == "pre-install" ]]; then
:
elif [[ "$2" == "install" ]]; then
install_isoflat
elif [[ "$2" == "post-config" ]]; then
if is_service_enabled q-agt neutron-agent; then
source $NEUTRON_DIR/devstack/lib/l2_agent
plugin_agent_add_l2_agent_extension isoflat
configure_l2_agent
fi
elif [[ "$2" == "extra" ]]; then
:
fi
elif [[ "$1" == "unstack" ]]; then
:
fi
fi
5 changes: 5 additions & 0 deletions devstack/settings
@@ -0,0 +1,5 @@
ABSOLUTE_PATH=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
ISOFLAT_PLUGIN_PATH=$ABSOLUTE_PATH/..
ISOFLAT_PLUGIN_CONF_FILE="/etc/neutron/isoflat.ini"
ISOFLAT_OVS_AGENT_BINARY="$NEUTRON_BIN_DIR/neutron-isoflat-openvswitch-agent"
ISOFLAT_OVS_AGENT_CONF_FILE="/etc/neutron/isoflat.ini"
1 change: 0 additions & 1 deletion neutron_isoflat/extensions/isoflat.py
Expand Up @@ -71,7 +71,6 @@ class InvalidNetworkType(qexception.Invalid):

# Class name here has to be lowercase except the initial letter
class Isoflat(extensions.ExtensionDescriptor):
"""API extension for handling HDN tasks."""

@classmethod
def get_name(cls):
Expand Down

0 comments on commit 22d3705

Please sign in to comment.