request.py: Don't call master if we already know that it will fail

parent 13fce878
......@@ -140,9 +140,12 @@ class Recipe(object):
if self.failed is not None:
# Check instance status to know if instance has been deployed
try:
status = self.instance.getState()
if self.instance.getComputerId() is not None:
status = self.instance.getState()
else:
status = 'not ready yet'
except (slapmodule.NotFoundError, slapmodule.ServerError):
status = 'not ready yet, please try again'
status = 'not ready yet'
except AttributeError:
status = 'unknown'
error_message = 'Connection parameter %s not found. '\
......@@ -163,7 +166,10 @@ class RequestOptional(Recipe):
if self.failed is not None:
# Check instance status to know if instance has been deployed
try:
status = self.instance.getState()
if self.instance.getComputerId() is not None:
status = self.instance.getState()
else:
status = 'not ready yet'
except (slapmodule.NotFoundError, slapmodule.ServerError):
status = 'not ready yet'
except AttributeError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment