Fixed issue with waiting for ssh of deleted cluster

If we will delete cluster during waiting for ssh,
check_cluster_exists will be unreachable. 
We should move it up.

Change-Id: I3935269ad7b8a771490f193653d73b17d4b30708
Closes-bug: 1439396
This commit is contained in:
Vitaly Gridnev 2015-04-02 00:32:06 +04:00
parent 99e2044a7a
commit cfb5eb5129
1 changed files with 2 additions and 2 deletions

View File

@ -108,6 +108,8 @@ class Engine(object):
'wait_until_accessible', _("Wait for instance accessibility"),
sleep=5)
def _is_accessible(self, instance):
if not g.check_cluster_exists(instance.cluster):
return True
try:
# check if ssh is accessible and cloud-init
# script is finished generating authorized_keys
@ -126,8 +128,6 @@ class Engine(object):
mgmt_ip=instance.management_ip, reason=ex))
return False
if not g.check_cluster_exists(instance.cluster):
return True
return False
@cpo.event_wrapper(mark_successful_on_exit=True)