Solved problem in AWS when listing networks (it was conflicting with code for sdn-assist). Modified the info the connector reports about the instance, now, if possible, the public IP is reported instead of the private one
Change-Id: I0c46c5d62ad0777615e7ba234d2a912d9353dc1b
Signed-off-by: montesmoreno <pablo.montesmoreno@telefonica.com>
diff --git a/osm_ro/vimconn_aws.py b/osm_ro/vimconn_aws.py
index f0eebb6..6621345 100644
--- a/osm_ro/vimconn_aws.py
+++ b/osm_ro/vimconn_aws.py
@@ -351,12 +351,12 @@
if filter_dict != {}:
if 'tenant_id' in filter_dict:
tfilters['vpcId'] = filter_dict['tenant_id']
- subnets = self.conn_vpc.get_all_subnets(subnet_ids=filter_dict.get('id', None), filters=tfilters)
+ subnets = self.conn_vpc.get_all_subnets(subnet_ids=filter_dict.get('name', None), filters=tfilters)
net_list = []
for net in subnets:
net_list.append(
{'id': str(net.id), 'name': str(net.id), 'status': str(net.state), 'vpc_id': str(net.vpc_id),
- 'cidr_block': str(net.cidr_block)})
+ 'cidr_block': str(net.cidr_block), 'type': 'bridge'})
return net_list
except Exception as e:
self.format_vimconn_exception(e)
@@ -796,7 +796,10 @@
interface_dict['vim_interface_id'] = interface.id
interface_dict['vim_net_id'] = interface.subnet_id
interface_dict['mac_address'] = interface.mac_address
- interface_dict['ip_address'] = interface.private_ip_address
+ if hasattr(interface, 'publicIp') and interface.publicIp != None:
+ interface_dict['ip_address'] = interface.publicIp + ";" + interface.private_ip_address
+ else:
+ interface_dict['ip_address'] = interface.private_ip_address
instance_dict['interfaces'].append(interface_dict)
except Exception as e:
self.logger.error("Exception getting vm status: %s", str(e), exc_info=True)