Fix bugs around dhcp4_flag
This commit is contained in:
parent
3816da6be6
commit
096a740c4f
|
@ -733,6 +733,8 @@ def net_add(vni, description, nettype, domain, name_servers,
|
||||||
"""
|
"""
|
||||||
Add a virtual client network to the PVC cluster.
|
Add a virtual client network to the PVC cluster.
|
||||||
"""
|
"""
|
||||||
|
if dhcp4_flag:
|
||||||
|
dhcp4_flag = bool(strtobool(dhcp4_flag))
|
||||||
zk_conn = pvc_common.startZKConnection(config['coordinators'])
|
zk_conn = pvc_common.startZKConnection(config['coordinators'])
|
||||||
retflag, retdata = pvc_network.add_network(zk_conn, vni, description, nettype, domain, name_servers,
|
retflag, retdata = pvc_network.add_network(zk_conn, vni, description, nettype, domain, name_servers,
|
||||||
ip4_network, ip4_gateway, ip6_network, ip6_gateway,
|
ip4_network, ip4_gateway, ip6_network, ip6_gateway,
|
||||||
|
@ -756,6 +758,8 @@ def net_modify(vni, description, domain, name_servers,
|
||||||
"""
|
"""
|
||||||
Modify a virtual client network in the PVC cluster.
|
Modify a virtual client network in the PVC cluster.
|
||||||
"""
|
"""
|
||||||
|
if dhcp4_flag:
|
||||||
|
dhcp4_flag = bool(strtobool(dhcp4_flag))
|
||||||
zk_conn = pvc_common.startZKConnection(config['coordinators'])
|
zk_conn = pvc_common.startZKConnection(config['coordinators'])
|
||||||
retflag, retdata = pvc_network.modify_network(zk_conn, vni, description, domain, name_servers,
|
retflag, retdata = pvc_network.modify_network(zk_conn, vni, description, domain, name_servers,
|
||||||
ip4_network, ip4_gateway, ip6_network, ip6_gateway,
|
ip4_network, ip4_gateway, ip6_network, ip6_gateway,
|
||||||
|
|
|
@ -1608,7 +1608,7 @@ class API_Network_Root(Resource):
|
||||||
reqargs.get('ip4_gateway', None),
|
reqargs.get('ip4_gateway', None),
|
||||||
reqargs.get('ip6_network', None),
|
reqargs.get('ip6_network', None),
|
||||||
reqargs.get('ip6_gateway', None),
|
reqargs.get('ip6_gateway', None),
|
||||||
reqargs.get('dhcp4_flag', None),
|
reqargs.get('dhcp4', None),
|
||||||
reqargs.get('dhcp4_start', None),
|
reqargs.get('dhcp4_start', None),
|
||||||
reqargs.get('dhcp4_end', None),
|
reqargs.get('dhcp4_end', None),
|
||||||
)
|
)
|
||||||
|
@ -1732,7 +1732,7 @@ class API_Network_Element(Resource):
|
||||||
reqargs.get('ip4_gateway', None),
|
reqargs.get('ip4_gateway', None),
|
||||||
reqargs.get('ip6_network', None),
|
reqargs.get('ip6_network', None),
|
||||||
reqargs.get('ip6_gateway', None),
|
reqargs.get('ip6_gateway', None),
|
||||||
reqargs.get('dhcp4_flag', None),
|
reqargs.get('dhcp4', None),
|
||||||
reqargs.get('dhcp4_start', None),
|
reqargs.get('dhcp4_start', None),
|
||||||
reqargs.get('dhcp4_end', None),
|
reqargs.get('dhcp4_end', None),
|
||||||
)
|
)
|
||||||
|
@ -1828,7 +1828,7 @@ class API_Network_Element(Resource):
|
||||||
reqargs.get('ip4_gateway', None),
|
reqargs.get('ip4_gateway', None),
|
||||||
reqargs.get('ip6_network', None),
|
reqargs.get('ip6_network', None),
|
||||||
reqargs.get('ip6_gateway', None),
|
reqargs.get('ip6_gateway', None),
|
||||||
reqargs.get('dhcp4_flag', None),
|
reqargs.get('dhcp4', None),
|
||||||
reqargs.get('dhcp4_start', None),
|
reqargs.get('dhcp4_start', None),
|
||||||
reqargs.get('dhcp4_end', None),
|
reqargs.get('dhcp4_end', None),
|
||||||
)
|
)
|
||||||
|
|
|
@ -253,10 +253,6 @@ def add_network(zk_conn, vni, description, nettype,
|
||||||
if nettype == 'managed' and not domain:
|
if nettype == 'managed' and not domain:
|
||||||
domain = '{}.local'.format(description)
|
domain = '{}.local'.format(description)
|
||||||
|
|
||||||
# Make sure the DHCP4 flag is always boolean
|
|
||||||
if dhcp4_flag is None:
|
|
||||||
dhcp4_flag = False
|
|
||||||
|
|
||||||
# Add the new network to Zookeeper
|
# Add the new network to Zookeeper
|
||||||
zkhandler.writedata(zk_conn, {
|
zkhandler.writedata(zk_conn, {
|
||||||
'/networks/{}'.format(vni): description,
|
'/networks/{}'.format(vni): description,
|
||||||
|
|
Loading…
Reference in New Issue