File: l2_agent_sriovnicswitch

package info (click to toggle)
neutron 2%3A27.0.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,004 kB
  • sloc: python: 296,384; sh: 1,507; makefile: 292; ruby: 35; sql: 19
file content (35 lines) | stat: -rw-r--r-- 1,177 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
SRIOV_AGENT_CONF="${NEUTRON_CORE_PLUGIN_CONF_PATH}/sriov_agent.ini"
SRIOV_AGENT_BINARY="${NEUTRON_BIN_DIR}/neutron-sriov-nic-agent"

function configure_l2_agent_sriovnicswitch {
    if [[ -n "$PHYSICAL_NETWORK" ]] && [[ -n "$PHYSICAL_INTERFACE" ]]; then
        PHYSICAL_DEVICE_MAPPINGS=$PHYSICAL_NETWORK:$PHYSICAL_INTERFACE
    fi
    if [[ -n "$PHYSICAL_DEVICE_MAPPINGS" ]]; then
        iniset /$SRIOV_AGENT_CONF sriov_nic physical_device_mappings $PHYSICAL_DEVICE_MAPPINGS
    fi

    iniset /$SRIOV_AGENT_CONF securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver

    iniset /$SRIOV_AGENT_CONF agent extensions "$L2_AGENT_EXTENSIONS"
}

function start_l2_agent_sriov {
    local SERVICE_NAME
    if is_neutron_legacy_enabled; then
        SERVICE_NAME=q-sriov-agt
    else
        SERVICE_NAME=neutron-sriov-agent
    fi
    run_process $SERVICE_NAME "$SRIOV_AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$SRIOV_AGENT_CONF"
}

function stop_l2_agent_sriov {
    local SERVICE_NAME
    if is_neutron_legacy_enabled; then
        SERVICE_NAME=q-sriov-agt
    else
        SERVICE_NAME=neutron-sriov-agent
    fi
    stop_process $SERVICE_NAME
}