From 3b299bbb122334ae911cd75ee6f8136c04399fa1 Mon Sep 17 00:00:00 2001 From: montesmoreno Date: Mon, 2 Oct 2017 18:19:05 +0200 Subject: [PATCH] Minor modifications to include vim_id of interfaces when creating a vm Change-Id: Ie44f998d2c37c26d78cec9b93d9fb634221ffcb5 Signed-off-by: montesmoreno --- osm_ro/vimconn_aws.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.25.1