summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Lynn <ethanlynnl@vmware.com>2018-05-07 10:45:23 +0800
committerEthan Lynn <ethanlynnl@vmware.com>2018-05-08 15:51:05 +0800
commit0e0d72aaae35976e0ef895754bcbfd387debdb70 (patch)
treed461b705d72c6943200a5d0c24a45a9016b5b00c
parent047cd399f8e63a9d524892d718cbe142020d8612 (diff)
Support multiple IP addresses on server create API
Add multiple IP addresses support for VFC server create API Change-Id: Ib71dfa608a95b3176d0d16d887b1cf589ef1df99 Issue-ID: MULTICLOUD-224 Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
-rw-r--r--vio/vio/pub/vim/vimapi/network/OperatePort.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/vio/vio/pub/vim/vimapi/network/OperatePort.py b/vio/vio/pub/vim/vimapi/network/OperatePort.py
index 4a059f1..b9abb60 100644
--- a/vio/vio/pub/vim/vimapi/network/OperatePort.py
+++ b/vio/vio/pub/vim/vimapi/network/OperatePort.py
@@ -58,8 +58,13 @@ class OperatePort(BaseNet):
subnet = network.subnet_get(body['subnetId'])
body['subnetId'] = subnet.id
if "ip" in body:
- body['fixed_ips'] = [{'subnet_id': body.pop('subnetId'),
- "ip_address": body.pop('ip')}]
+ ips = body.pop("ip").split(",")
+ body['fixed_ips'] = []
+ subnet_id = body.pop('subnetId')
+ for ip in ips:
+ body['fixed_ips'].append({
+ 'subnet_id': subnet_id,
+ "ip_address": ip})
else:
body['fixed_ips'] = [{'subnet_id': body.pop('subnetId')}]
port = network.port_create(**body)