aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2018-01-26 09:56:12 +0100
committerPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>2018-01-26 09:56:12 +0100
commit049d8ffac11de402ab7db3e96609faada13c2902 (patch)
treea7cf03844a6163aa968253fe879436a07e61a65e
parentbbfe9b09d2b1ac7bfe286311fef83d36c6125c96 (diff)
proper instance status handling
This would fix the exception happening in the SDNVPN CI testsuite. Example: http://artifacts.opnfv.org/logs/functest/lf-pod1/2018-01-21_17-18-06/bgpvpn.log Change-Id: Ie22dcdbba5299177d4e98e5995433553df5bfa68 Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
-rw-r--r--functest/utils/openstack_utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/functest/utils/openstack_utils.py b/functest/utils/openstack_utils.py
index 1d7cdafb9..655ca464f 100644
--- a/functest/utils/openstack_utils.py
+++ b/functest/utils/openstack_utils.py
@@ -519,7 +519,10 @@ def create_instance_and_wait_for_active(flavor_name,
count = VM_BOOT_TIMEOUT / SLEEP
for n in range(count, -1, -1):
status = get_instance_status(nova_client, instance)
- if status.lower() == "active":
+ if status is None:
+ time.sleep(SLEEP)
+ continue
+ elif status.lower() == "active":
return instance
elif status.lower() == "error":
logger.error("The instance %s went to ERROR status."