From 852c9a048d462bcd19ee91a7cf34704d72a20945 Mon Sep 17 00:00:00 2001 From: Amos Kong Date: Tue, 11 Dec 2018 16:56:29 +0800 Subject: [PATCH] wait until the instance exists before modify its attribute Sometimes, instance can't be created immediately, it failed to modify its name attribute for that instance doesn't exist. This patch added wait to make sure the instance exists. Signed-off-by: Amos Kong --- avocado_ec2/ec2_wrapper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/avocado_ec2/ec2_wrapper.py b/avocado_ec2/ec2_wrapper.py index e9cc4af..4bdbf68 100644 --- a/avocado_ec2/ec2_wrapper.py +++ b/avocado_ec2/ec2_wrapper.py @@ -120,6 +120,7 @@ def _init_resources(self, args): global EC2_INSTANCES EC2_INSTANCES += inst_list self.instance = inst_list[0] + self.instance.wait_until_exists() log = logging.getLogger("avocado.app") log.info("EC2_ID : %s", self.instance.id) # Rename the instance