exclude subnets without gateway in create interface

In create interface form, if we select the subnet which
don't have gateway ip, the create will fail.

we can remove the subnets which don't have gateway ip
from the sebnet options to prevent the unnecessary
server call.

Change-Id: I75cec674516b07e141d74729b545e3d2cadee82d
Closes-Bug: #1478939
This commit is contained in:
Masco Kaliyamoorthy 2015-07-28 18:13:33 +05:30 committed by Masco
parent 7794cd53a7
commit ce65691bfc
1 changed files with 2 additions and 1 deletions

View File

@ -76,7 +76,8 @@ class AddInterface(forms.SelfHandlingForm):
'%s%s (%s)' % (net_name, subnet.cidr,
subnet.name or subnet.id))
for subnet in n['subnets']
if subnet.id not in router_subnet_ids]
if subnet.id not in router_subnet_ids
and subnet.gateway_ip]
if choices:
choices.insert(0, ("", _("Select Subnet")))
else: