File: plugin.sh

package info (click to toggle)
networking-bagpipe 23.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,872 kB
  • sloc: python: 15,677; sh: 927; makefile: 62
file content (48 lines) | stat: -rw-r--r-- 1,814 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

# Save trace setting
_XTRACE_NETWORKING_BAGPIPE=$(set +o | grep xtrace)
set -o xtrace

if [[ "$1" == "stack" && "$2" == "pre-install" ]]; then
    # no-op
    :
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
    setup_develop $NETWORKING_BAGPIPE_DIR
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
    if is_service_enabled neutron-agent || is_service_enabled q-agt ; then
        if is_neutron_legacy_enabled; then
            iniset /$Q_PLUGIN_CONF_FILE bagpipe bagpipe_bgp_port $BAGPIPE_SERVICE_PORT
        else
            iniset $NEUTRON_CORE_PLUGIN_CONF bagpipe_bgp_port $BAGPIPE_SERVICE_PORT
        fi
    fi
    if [[ "$ENABLE_BAGPIPE_L2" == "True" ]]; then
        if is_service_enabled neutron-agent || is_service_enabled q-agt ; then
            echo_summary "Configuring linuxbridge agent for bagpipe"
            if is_neutron_legacy_enabled; then
                iniset /$Q_PLUGIN_CONF_FILE ml2_bagpipe_extension as_number ${BAGPIPE_RT_ASN:-64512}
                iniset /$Q_PLUGIN_CONF_FILE vxlan arp_responder True
            else
                iniset $NEUTRON_CORE_PLUGIN_CONF ml2_bagpipe_extension as_number ${BAGPIPE_RT_ASN:-64512}
                iniset $NEUTRON_CORE_PLUGIN_CONF vxlan arp_responder True
            fi
            source $NEUTRON_DIR/devstack/lib/l2_agent
            plugin_agent_add_l2_agent_extension bagpipe
            configure_l2_agent
        fi
    fi
fi
if [[ "$1" == "unstack" ]]; then
    rm -f $TOP_DIR/lib/neutron_plugins/${BAGPIPE_L2_AGENT}_agent
fi
if [[ "$1" == "clean" ]]; then
    #no-op
    :
fi

echo "Running bagpipe-bgp devstack plugin..."
source $NETWORKING_BAGPIPE_DIR/devstack/plugin.sh.bagpipe_bgp $1 $2 || die $LINEO "error in bagpipe-bgp plugin.sh ($1 $2)"

# Restore trace setting
${_XTRACE_NETWORKING_BAGPIPE}