summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryangyan <yangyanyj@chinamobile.com>2020-02-28 11:59:26 +0800
committerYan Yang <yangyanyj@chinamobile.com>2020-02-28 08:24:11 +0000
commit5e30dfe5a80c93e7c10ade7de6cca103b20d5d9d (patch)
treedf4201c032f808f4aedd7282483d301782232c01
parent4c86f50e1a6b7f2f95f400d9836f2ad79b57c3dd (diff)
Adaptive enabledhcp field type
Change-Id: Ied2d6b244aecb703c4808eeeabd177d02a21d0b6 Issue-ID: VFC-1625 Signed-off-by: yangyan <yangyanyj@chinamobile.com>
-rw-r--r--lcm/pub/nfvi/vim/api/multivim/api.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lcm/pub/nfvi/vim/api/multivim/api.py b/lcm/pub/nfvi/vim/api/multivim/api.py
index 11a772ee..82e42913 100644
--- a/lcm/pub/nfvi/vim/api/multivim/api.py
+++ b/lcm/pub/nfvi/vim/api/multivim/api.py
@@ -347,6 +347,8 @@ class MultiVimApi:
if "ip_version" in subnet and subnet["ip_version"]:
subnet_data["ipVersion"] = int(subnet["ip_version"])
if "enable_dhcp" in subnet and subnet["enable_dhcp"]:
+ if isinstance(subnet["enable_dhcp"], str):
+ subnet["enable_dhcp"] = (subnet["enable_dhcp"]).strip().lower() in "true"
subnet_data["enableDhcp"] = int(subnet["enable_dhcp"]) == const.ENABLE_DHCP
if "gateway_ip" in subnet and subnet["gateway_ip"]:
subnet_data["gatewayIp"] = subnet["gateway_ip"]