Merge release branch 4.7 to 4.8

* 4.7:
  Display hostname the VPC router runs on
  CLOUDSTACK-9266: Make deleting static routes in private gw work
  CLOUDSTACK-9264: Make /32 static routes for private gw work
This commit is contained in:
Remi Bergsma 2016-02-04 09:26:53 +01:00
commit be89f64731
3 changed files with 6 additions and 11 deletions

View File

@ -85,13 +85,13 @@ class CsStaticRoutes(CsDataBag):
def __update(self, route): def __update(self, route):
if route['revoke']: if route['revoke']:
command = "route del -net %s gw %s" % (route['network'], route['gateway']) command = "ip route del %s via %s" % (route['network'], route['gateway'])
result = CsHelper.execute(command) result = CsHelper.execute(command)
else: else:
command = "ip route show | grep %s | awk '{print $1, $3}'" % route['network'] command = "ip route show | grep %s | awk '{print $1, $3}'" % route['network']
result = CsHelper.execute(command) result = CsHelper.execute(command)
if not result: if not result:
route_command = "route add -net %s gw %s" % (route['network'], route['gateway']) route_command = "ip route add %s via %s" % (route['network'], route['gateway'])
result = CsHelper.execute(route_command) result = CsHelper.execute(route_command)

View File

@ -21,13 +21,5 @@ from pprint import pprint
def merge(dbag, staticroutes): def merge(dbag, staticroutes):
for route in staticroutes['routes']: for route in staticroutes['routes']:
key = route['network'] key = route['network']
revoke = route['revoke']
if revoke:
try:
del dbag[key]
except KeyError:
pass
else:
dbag[key] = route dbag[key] = route
return dbag return dbag

View File

@ -5859,6 +5859,9 @@
linklocalip: { linklocalip: {
label: 'label.linklocal.ip' label: 'label.linklocal.ip'
}, },
hostname: {
label: 'label.host'
},
state: { state: {
label: 'label.state' label: 'label.state'
}, },