Static routes should always be added.
Even if the route exists on the current host, we are re-writing the script run by udev, so the static routes must always be added to the script. Also, always check fixed strings rather than regular expressions for the networks (which contain periods!) Change-Id: I94cfd53506a915309095da0f5f8b9db397f81892
This commit is contained in:
parent
c7a1a414f1
commit
ee86d2d0f0
|
@ -283,13 +283,14 @@ def route_to_compute(endpoints, himn_xs, himn_local, username):
|
|||
params = ['route', 'add', '-net', net, 'netmask',
|
||||
mask, 'gw', himn_local]
|
||||
ssh(himn_xs, username, *params)
|
||||
cmd = (
|
||||
"printf 'if !(/sbin/route -n | /bin/grep -q {net}); then\n"
|
||||
"/sbin/route add -net {net} netmask {mask} gw {himn_local};\n"
|
||||
"fi\n' >> /etc/udev/scripts/reroute.sh"
|
||||
)
|
||||
cmd = cmd.format(net=net, mask=mask, himn_local=himn_local)
|
||||
ssh(himn_xs, username, cmd)
|
||||
# Always add the route to the udev, even if it's currently active
|
||||
cmd = (
|
||||
"printf 'if !(/sbin/route -n | /bin/grep -q -F {net}); then\n"
|
||||
"/sbin/route add -net {net} netmask {mask} gw {himn_local};\n"
|
||||
"fi\n' >> /etc/udev/scripts/reroute.sh"
|
||||
)
|
||||
cmd = cmd.format(net=net, mask=mask, himn_local=himn_local)
|
||||
ssh(himn_xs, username, cmd)
|
||||
else:
|
||||
logging.info('%s network ip is missing' % endpoint_name)
|
||||
ssh(himn_xs, username, 'chmod +x /etc/udev/scripts/reroute.sh')
|
||||
|
|
|
@ -3,7 +3,7 @@ name: fuel-plugin-xenserver
|
|||
# Human-readable name for your plugin
|
||||
title: XenServer Plugin
|
||||
# Plugin version
|
||||
version: '3.1.1'
|
||||
version: '3.1.2'
|
||||
# Description
|
||||
description: Enable Mirantis OpenStack to integrate with Xenserver
|
||||
# Required fuel version
|
||||
|
|
Loading…
Reference in New Issue