summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Ke <lokyse@163.com>2018-05-09 05:19:29 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-09 05:19:29 +0000
commit69bf5aff787a6a37688ee212f6e6612da8c29b77 (patch)
tree8be0e0d9e5de62d44feca353e99529efbc3c9669
parent3160fcb9b60b561d939157a77ec28deb323a06cc (diff)
parent0e0d72aaae35976e0ef895754bcbfd387debdb70 (diff)
Merge "Support multiple IP addresses on server create API"
-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)