diff --git a/client-api/api_lib/pvcapi_helper.py b/client-api/api_lib/pvcapi_helper.py index 47f5a27a..2a10ea9d 100755 --- a/client-api/api_lib/pvcapi_helper.py +++ b/client-api/api_lib/pvcapi_helper.py @@ -733,6 +733,8 @@ def net_add(vni, description, nettype, domain, name_servers, """ 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']) retflag, retdata = pvc_network.add_network(zk_conn, vni, description, nettype, domain, name_servers, 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. """ + if dhcp4_flag: + dhcp4_flag = bool(strtobool(dhcp4_flag)) zk_conn = pvc_common.startZKConnection(config['coordinators']) retflag, retdata = pvc_network.modify_network(zk_conn, vni, description, domain, name_servers, ip4_network, ip4_gateway, ip6_network, ip6_gateway, diff --git a/client-api/pvc-api.py b/client-api/pvc-api.py index 31bb30ba..63a945f7 100755 --- a/client-api/pvc-api.py +++ b/client-api/pvc-api.py @@ -1608,7 +1608,7 @@ class API_Network_Root(Resource): reqargs.get('ip4_gateway', None), reqargs.get('ip6_network', None), reqargs.get('ip6_gateway', None), - reqargs.get('dhcp4_flag', None), + reqargs.get('dhcp4', None), reqargs.get('dhcp4_start', None), reqargs.get('dhcp4_end', None), ) @@ -1732,7 +1732,7 @@ class API_Network_Element(Resource): reqargs.get('ip4_gateway', None), reqargs.get('ip6_network', None), reqargs.get('ip6_gateway', None), - reqargs.get('dhcp4_flag', None), + reqargs.get('dhcp4', None), reqargs.get('dhcp4_start', None), reqargs.get('dhcp4_end', None), ) @@ -1828,7 +1828,7 @@ class API_Network_Element(Resource): reqargs.get('ip4_gateway', None), reqargs.get('ip6_network', None), reqargs.get('ip6_gateway', None), - reqargs.get('dhcp4_flag', None), + reqargs.get('dhcp4', None), reqargs.get('dhcp4_start', None), reqargs.get('dhcp4_end', None), ) diff --git a/client-common/network.py b/client-common/network.py index 1d39dc7f..fcda03e9 100644 --- a/client-common/network.py +++ b/client-common/network.py @@ -253,10 +253,6 @@ def add_network(zk_conn, vni, description, nettype, if nettype == 'managed' and not domain: 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 zkhandler.writedata(zk_conn, { '/networks/{}'.format(vni): description,