From: montesmoreno Date: Mon, 2 Oct 2017 16:19:05 +0000 (+0200) Subject: Minor modifications to include vim_id of interfaces when creating a vm X-Git-Tag: v3.0.0~6 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F92%2F5492%2F2;p=osm%2FRO.git Minor modifications to include vim_id of interfaces when creating a vm Change-Id: Ie44f998d2c37c26d78cec9b93d9fb634221ffcb5 Signed-off-by: montesmoreno --- diff --git a/osm_ro/vimconn_aws.py b/osm_ro/vimconn_aws.py index 5ee75e4e..3ccef44a 100644 --- a/osm_ro/vimconn_aws.py +++ b/osm_ro/vimconn_aws.py @@ -651,9 +651,7 @@ class vimconnector(vimconn.vimconnector): security_groups=self.security_groups, user_data=userdata ) - instance = reservation.instances[0] else: - net_list = [net_list[0]] for index, subnet in enumerate(net_list): net_intr = boto.ec2.networkinterface.NetworkInterfaceSpecification(subnet_id=subnet.get('net_id'), groups=None, @@ -672,7 +670,6 @@ class vimconnector(vimconn.vimconnector): network_interfaces=boto.ec2.networkinterface.NetworkInterfaceCollection(net_intr), user_data=userdata ) - instance = reservation.instances[0] else: while True: try: @@ -682,6 +679,9 @@ class vimconnector(vimconn.vimconnector): break except: time.sleep(10) + net_list[index]['vim_id'] = reservation.instances[0].interfaces[index].id + + instance = reservation.instances[0] return instance.id except Exception as e: self.format_vimconn_exception(e)