Skip to content

Commit

Permalink
Merge 948bdf5 into 6a40f48
Browse files Browse the repository at this point in the history
  • Loading branch information
katyafervent committed Jul 4, 2018
2 parents 6a40f48 + 948bdf5 commit bcb5c47
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions kqueen/engines/openstack_kubespray.py
Expand Up @@ -78,7 +78,7 @@ class OpenstackKubesprayEngine(BaseEngine):
"help_message": "Must be odd number",
"validators": {
"required": True,
"minimum": 3,
"min": 3,
},
},
"slave_count": {
Expand All @@ -101,6 +101,9 @@ class OpenstackKubesprayEngine(BaseEngine):
"order": 70,
"label": "Comma separated list of nameservers",
"default": config.KS_DEFAULT_NAMESERVERS,
"validators": {
"ip_list": True,
},
},
"availability_zone": {
"type": "text",
Expand Down Expand Up @@ -196,7 +199,14 @@ def provision(self):
try:
self.cluster.state = config.CLUSTER_PROVISIONING_STATE
self.cluster.save()
app.executor.submit(self._run_provisioning)
future = app.executor.submit(self._run_provisioning)
try:
error = future.exception(timeout=11)
if error:
return False, error
except Exception as e:
# No error occurred for the provided timeout
return True, None
except Exception as e:
message = "Failed to submit provisioning task: %s" % e
logger.exception(message)
Expand All @@ -219,6 +229,9 @@ def _run_provisioning(self):
except Exception as e:
self.cluster.state = config.CLUSTER_ERROR_STATE
logger.exception("Failed to provision cluster: %s" % e)
self.cluster.metadata['status_message'] = getattr(e, 'details', repr(e))
self.cluster.save()
raise e
finally:
self.cluster.save()

Expand Down

0 comments on commit bcb5c47

Please sign in to comment.