Debian Codegraph @

devstack/plugin.sh

raw
1 #!/bin/bash
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
13 # under the License.
14
15 # Save trace setting
16 _XTRACE_OVN_BGP_AGENT_PLUGIN=$(set +o | grep xtrace)
17 set +o xtrace
18 source $DEST/ovn-bgp-agent/devstack/lib/ovn-bgp-agent
19
20 # Main loop
21 if is_service_enabled q-svc ovn-controller; then
22 # Stack
23 if [[ "$1" == "stack" && "$2" == "install" ]]; then
24 install_frr
25 configure_frr
26 init_frr
27 install_ovn_bgp_agent
28 configure_ovn_bgp_agent
29 init_ovn_bgp_agent
30 elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
31 start_ovn_bgp_agent
32 start_frr
33 fi
34
35 # Unstack
36 if [[ "$1" == "unstack" ]]; then
37 stop_ovn_bgp_agent
38 stop_frr
39 fi
40
41 # Clean
42 if [[ "$1" == "clean" ]]; then
43 cleanup_ovn_bgp_agent
44 cleanup_frr
45 fi
46 fi
47
48 # Restore xtrace
49 $_XTRACE_OVN_BGP_AGENT_PLUGIN