From 17b6af3ee6cb1529b9f9fb3abc65b9b0d9f4c4bf Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 6 Jan 2020 13:19:27 -0500 Subject: [PATCH] Only split nameservers if needed --- client-api/pvc-api.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/client-api/pvc-api.py b/client-api/pvc-api.py index be2c59d3..31bb30ba 100755 --- a/client-api/pvc-api.py +++ b/client-api/pvc-api.py @@ -1594,12 +1594,16 @@ class API_Network_Root(Resource): type: object id: Message """ + if reqargs.get('name_servers', None): + name_servers = reqargs.get('name_servers', None).split(',') + else: + name_servers = '' return api_helper.net_add( reqargs.get('vni', None), reqargs.get('description', None), reqargs.get('nettype', None), reqargs.get('domain', None), - reqargs.get('name_servers', None).split(','), + name_servers, reqargs.get('ip4_network', None), reqargs.get('ip4_gateway', None), reqargs.get('ip6_network', None), @@ -1714,12 +1718,16 @@ class API_Network_Element(Resource): type: object id: Message """ + if reqargs.get('name_servers', None): + name_servers = reqargs.get('name_servers', None).split(',') + else: + name_servers = '' return api_helper.net_add( reqargs.get('vni', None), reqargs.get('description', None), reqargs.get('nettype', None), reqargs.get('domain', None), - reqargs.get('name_servers', None), + name_servers, reqargs.get('ip4_network', None), reqargs.get('ip4_gateway', None), reqargs.get('ip6_network', None), @@ -1807,11 +1815,15 @@ class API_Network_Element(Resource): type: object id: Message """ + if reqargs.get('name_servers', None): + name_servers = reqargs.get('name_servers', None).split(',') + else: + name_servers = '' return api_helper.net_modify( vni, reqargs.get('description', None), reqargs.get('domain', None), - reqargs.get('name_servers', None), + name_servers, reqargs.get('ip4_network', None), reqargs.get('ip4_gateway', None), reqargs.get('ip6_network', None),