3 # This script is patching /usr/lib/python2.7/dist-packages/nova/network/linux_net.py
4 # More specifically it's adding '1' as recognized exit code
5 # it's WA and will work just when _setr_device_mtu will not change dramatically
7 # step1) get ROW for patching
8 FILE="/usr/lib/python2.7/dist-packages/nova/network/linux_net.py"
10 ROW=`grep -n "def _set_device_mtu(dev, mtu=None):" $FILE | cut -d ":" -f 1`
12 # step2) use sed for patching it
14 sed -i.bck "$((ROW+8))s/check_exit_code=\[0, 2, 254\]/check_exit_code=\[0, 1, 2, 254\]/" $FILE
19 echo "WARNING: linux_net.py not patched, please check if it's really needed"
21 echo "SUCCESS: linux_net.py patched"