Calico provides Layer 3 Virtual Networking for Highly Scalable Data Centers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pre_install.sh 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. PWD=`pwd`
  3. FUEL_VERSION=`rpm -q --info fuel | tr -s \[:space:\] | grep 'Version :' | awk -F': ' '{print $2}'`
  4. if [ $FUEL_VERSION == '9.0.0' ] ; then
  5. # Implement minor patch to l23network (included into 9.1, but not present in 9.0)
  6. # For additional information see Openstack Bug #1590735
  7. # or Change-Id: I89ef5630ab2dfd373b8cd4b7db481278c659db75
  8. cd /etc/puppet/modules/l23network
  9. patch -N -p4 <<EOF
  10. diff --git a/deployment/puppet/l23network/lib/puppetx/l23_network_scheme.rb b/deployment/puppet/l23network/lib/puppetx/l23_network_scheme.rb
  11. index 4f80daf..a2c1049 100644
  12. --- a/deployment/puppet/l23network/lib/puppetx/l23_network_scheme.rb
  13. +++ b/deployment/puppet/l23network/lib/puppetx/l23_network_scheme.rb
  14. @@ -101,7 +101,13 @@
  15. transformations = org_tranformations.reject{|x| x[:action]=='override'}
  16. org_tranformations.select{|x| x[:action]=='override'}.each do |ov|
  17. next if ov[:override].nil?
  18. - tr_index = transformations.index{|x| x[:name]==ov[:override]}
  19. + pm = ov[:override].match(/patch-([\w\-]+)\:([\w\-]+)/)
  20. + if !pm.nil? and pm.size == 3
  21. + # we should override patch, to search patch use bridge names
  22. + tr_index = transformations.index{|x| x[:action]=='add-patch' and (x[:bridges]==[pm[1],pm[2]] or x[:bridges]==[pm[2],pm[1]])}
  23. + else
  24. + tr_index = transformations.index{|x| x[:name]==ov[:override]}
  25. + end
  26. next if tr_index.nil?
  27. ov.reject{|k,v| [:override, :action].include? k}.each do |k,v|
  28. if k == :'override-action' and v.to_s!=''
  29. EOF
  30. rc=$?
  31. if [ $rc -gt 1 ] ; then
  32. echo
  33. echo "Can't patch l23network module. Chech whether 'patch' utility installed."
  34. echo "rc=$rc"
  35. echo
  36. echo "Use 'yum install -y patch' if not found"
  37. echo
  38. exit $rc
  39. fi
  40. fi
  41. cd $PWD