aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/config/states/opendaylight
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2020-01-15 18:05:55 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2020-01-16 12:49:26 +0000
commit871a4eecdac3e8ea2a5da6c4a2e3787f5e95f1c0 (patch)
treefa88fc6892864304e64e089718bf9e5e73e1f4fe /mcp/config/states/opendaylight
parent238ed19eb4d7cd755bbc95c40e2399cc66eb6fc1 (diff)
odl: Make odl_hostconfig patching idempotent
Although rarely, ODL hostconfig patching for py3 compatibility silently fails, leading to fatal errors in later deploy stages. Skip said patch if already applied, respectively fail if the patch can't be applied. Change-Id: I1addf17f61fa01055c0db83056870a7e7b8d3a42 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com> (cherry picked from commit 29f7bab413201b24fa09c70eb08a569c78d56f9f)
Diffstat (limited to 'mcp/config/states/opendaylight')
-rwxr-xr-xmcp/config/states/opendaylight4
1 files changed, 3 insertions, 1 deletions
diff --git a/mcp/config/states/opendaylight b/mcp/config/states/opendaylight
index eb6cc6524..ae8b4cc92 100755
--- a/mcp/config/states/opendaylight
+++ b/mcp/config/states/opendaylight
@@ -21,5 +21,7 @@ wait_for 5.0 "salt -I 'opendaylight:server' state.sls opendaylight"
wait_for 20 "salt --out yaml -C 'I@neutron:server and *01*' network.connect $(odl bind_ip) $(odl rest_port) | fgrep -q 'result: true'"
# https://bugs.launchpad.net/networking-odl/+bug/1822559
+FILE=/usr/lib/python3/dist-packages/networking_odl/cmd/set_ovs_hostconfigs.py
+PFILE=/var/tmp/odl_hostconfig.patch
salt -I 'linux:network:bridge:openvswitch' pkg.install python3-networking-odl
-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
+salt -I 'linux:network:bridge:openvswitch' cmd.run "patch -R -s --dry-run $FILE < $PFILE || patch $FILE < $PFILE"