summaryrefslogtreecommitdiffstats
path: root/share/newton_base
diff options
context:
space:
mode:
authorKailun Qin <kailun.qin@intel.com>2018-04-16 17:25:34 +0800
committerKailun Qin <kailun.qin@intel.com>2018-04-17 11:50:43 +0800
commit0c44d30c0fabc73eea135685e54ea3ff643495f8 (patch)
treebc71cf3b3ca91e813d83606605f943d0bb5d7460 /share/newton_base
parent181c53c3dc4d7ec3c603e60d78358d9ba16deccc (diff)
Fix MC create_port not handle multiple ip address
Change-Id: Ie09370b275b39b2803a17da20711ea71d5539742 Issue-ID: MULTICLOUD-212 Signed-off-by: Kailun Qin <kailun.qin@intel.com>
Diffstat (limited to 'share/newton_base')
-rw-r--r--share/newton_base/openoapi/vport.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/share/newton_base/openoapi/vport.py b/share/newton_base/openoapi/vport.py
index 9656b5c0..e112d38c 100644
--- a/share/newton_base/openoapi/vport.py
+++ b/share/newton_base/openoapi/vport.py
@@ -147,12 +147,13 @@ class Vports(APIView):
tmpip = port.pop("ip", None)
tmpsubnet = port.pop("subnetId", None)
if tmpip and tmpsubnet:
- fixed_ip = {
- "ip_address": tmpip,
- "subnet_id": tmpsubnet,
- }
- port["fixed_ips"] = []
- port["fixed_ips"].append(fixed_ip)
+ port["fixed_ips"] = []
+ for one_tmpip in tmpip.split(','):
+ fixed_ip = {
+ "ip_address": one_tmpip,
+ "subnet_id": tmpsubnet,
+ }
+ port["fixed_ips"].append(fixed_ip)
VimDriverUtils.replace_key_by_mapping(port,
self.keys_mapping, True)