From: kasar Date: Fri, 31 Mar 2017 12:53:17 +0000 (-0700) Subject: Added code for ip_address parameter X-Git-Tag: v2.0.0~27 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F24%2F1424%2F1;p=osm%2FRO.git Added code for ip_address parameter Change-Id: I937f39c8be154fd57b000c4f24ff8e8cd4ecb034 Signed-off-by: kasar --- diff --git a/vimconn_vmware.py b/vimconn_vmware.py index 10111c1f..384da623 100644 --- a/vimconn_vmware.py +++ b/vimconn_vmware.py @@ -3640,9 +3640,19 @@ class vimconnector(vimconn.vimconnector): raise vimconn.vimconnConnectionException("Failed to connect vCloud director") try: + ip_address = None floating_ip = False if 'floating_ip' in net: floating_ip = net['floating_ip'] - allocation_mode = "POOL" if floating_ip else "DHCP" + + # Stub for ip_address feature + if 'ip_address' in net: ip_address = net['ip_address'] + + if floating_ip: + allocation_mode = "POOL" + elif ip_address: + allocation_mode = "MANUAL" + else: + allocation_mode = "DHCP" if not nic_type: for vms in vapp._get_vms(): @@ -3671,6 +3681,10 @@ class vimconnector(vimconn.vimconnector): {} """.format(primary_nic_index, network_name, nicIndex, allocation_mode) + # Stub for ip_address feature + if ip_address: + ip_tag = '{}'.format(ip_address) + item = item.replace('\n','\n{}\n'.format(ip_tag)) data = data.replace('\n','\n{}\n'.format(item)) else: @@ -3680,6 +3694,10 @@ class vimconnector(vimconn.vimconnector): {} """.format(network_name, nicIndex, allocation_mode) + # Stub for ip_address feature + if ip_address: + ip_tag = '{}'.format(ip_address) + new_item = new_item.replace('\n','\n{}\n'.format(ip_tag)) data = data.replace('\n','\n{}\n'.format(new_item)) @@ -3731,6 +3749,10 @@ class vimconnector(vimconn.vimconnector): {} """.format(primary_nic_index, network_name, nicIndex, allocation_mode, nic_type) + # Stub for ip_address feature + if ip_address: + ip_tag = '{}'.format(ip_address) + item = item.replace('\n','\n{}\n'.format(ip_tag)) data = data.replace('\n','\n{}\n'.format(item)) else: @@ -3741,6 +3763,10 @@ class vimconnector(vimconn.vimconnector): {} """.format(network_name, nicIndex, allocation_mode, nic_type) + # Stub for ip_address feature + if ip_address: + ip_tag = '{}'.format(ip_address) + new_item = new_item.replace('\n','\n{}\n'.format(ip_tag)) data = data.replace('\n','\n{}\n'.format(new_item))