summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)