Update OpenDaylight version to Neon
[fuel.git] / mcp / config / states / opendaylight
1 #!/bin/bash -e
2 ##############################################################################
3 # Copyright (c) 2018 Mirantis Inc., Enea AB and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
11
12 # shellcheck disable=SC1090
13 source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh"
14
15 # Get OpenDaylight server options with prefix odl_
16 function odl() {
17   salt --out txt -C 'I@opendaylight:server and *01*' pillar.get "opendaylight:server:odl_$1" | cut -d ' ' -f2
18 }
19
20 wait_for 5.0 "salt -I 'opendaylight:server' state.sls opendaylight"
21 wait_for 20 "salt --out yaml -C 'I@neutron:server and *01*' network.connect $(odl bind_ip) $(odl rest_port) | fgrep -q 'result: true'"
22
23 # https://bugs.launchpad.net/networking-odl/+bug/1822559
24 salt -I 'linux:network:bridge:openvswitch' pkg.install python3-networking-odl
25 salt -I 'linux:network:bridge:openvswitch' file.patch /usr/lib/python3/dist-packages/networking_odl/cmd/set_ovs_hostconfigs.py /var/tmp/odl_hostconfig.patch || true