From: Tony Mack Date: Mon, 15 Apr 2013 04:03:42 +0000 (-0400) Subject: update Subnet admin X-Git-Tag: 1.0~107 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=4ecbb2a2feb4f017e2fece9f20571261088d65bf;p=plstackapi.git update Subnet admin --- diff --git a/plstackapi/core/api/subnets.py b/plstackapi/core/api/subnets.py index a2417bc..44cd56f 100644 --- a/plstackapi/core/api/subnets.py +++ b/plstackapi/core/api/subnets.py @@ -42,7 +42,8 @@ def add_subnet(auth, fields): # add subnet as interface to slice's router driver.add_router_interface(subnet.slice.router_id, subnet.subnet_id) - + add_route = 'route add -net %s dev br-ex gw 10.100.0.5' % self.cidr + commands.getstatusoutput(add_route) subnet.save() return subnet @@ -56,6 +57,8 @@ def delete_subnet(auth, filter={}): driver.delete_router_interface(subnet.slice.router_id, subnet.subnet_id) driver.delete_subnet(subnet.subnet_id) subnet.delete() + del_route = 'route del -net %s' % self.cidr + commands.getstatusoutput(del_route) return 1 def get_subnets(auth, filter={}):