CLOUDSTACK-9793: Faster ip in subnet check

This change removes an unnecessary conversion from IPNetwork
to list in one of the router scripts. This makes the router
faster at processing static NAT rules, which can prevent
timeouts when attaching or detaching IPs.

(cherry picked from commit d5c5eb10f8)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Stefania 2017-02-08 16:01:34 +00:00 committed by Rohit Yadav
parent 859b2150cd
commit 73c30f1baa
1 changed files with 1 additions and 1 deletions

View File

@ -145,7 +145,7 @@ class CsInterface:
def ip_in_subnet(self, ip):
ipo = IPAddress(ip)
net = IPNetwork("%s/%s" % (self.get_ip(), self.get_size()))
return ipo in list(net)
return ipo in net
def get_gateway_cidr(self):
return "%s/%s" % (self.get_gateway(), self.get_size())