1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +00:00

Fixed bad gateway

This commit is contained in:
Retspen 2015-04-30 16:09:13 +03:00
parent 207df02d4d
commit d1cf4a0ffb

View file

@ -9,12 +9,8 @@ def network_size(net, dhcp=None):
"""
mask = IP(net).strNetmask()
addr = IP(net)
if addr[0].strNormal()[-1] == '0':
gateway = addr[1].strNormal()
dhcp_pool = [addr[2].strNormal(), addr[addr.len() - 2].strNormal()]
else:
gateway = addr[0].strNormal()
dhcp_pool = [addr[1].strNormal(), addr[addr.len() - 2].strNormal()]
gateway = addr[1].strNormal()
dhcp_pool = [addr[2].strNormal(), addr[addr.len() - 2].strNormal()]
if dhcp:
return gateway, mask, dhcp_pool
else: