Skip to content

Commit

Permalink
Merge pull request #121 from Mirantis/cluster-deploy
Browse files Browse the repository at this point in the history
Fix cluster deployment
  • Loading branch information
tomkukral authored Nov 11, 2017
2 parents 9615a78 + 1f1421c commit fcf351a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,5 @@ ENV/
node_modules/

# DO NOT COMMIT LOCAL CONFIG
kqueen/config_local.py
kqueen/config/local.py

10 changes: 9 additions & 1 deletion kqueen/blueprints/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,20 @@ def after_save(self):

if not prov_status:
logger.error('Provisioning failed: {}'.format(prov_msg))
abort(500)
abort(500, description=prov_msg)


class GetCluster(GetView):
object_class = Cluster

def dispatch_request(self, *args, **kwargs):
self.check_access()

cluster = self.get_content(*args, **kwargs)
cluster.get_state()

return jsonify(cluster)


class UpdateCluster(UpdateView):
object_class = Cluster
Expand Down
6 changes: 3 additions & 3 deletions kqueen/engines/jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ def provision(self, **kwargs):
ctx['STACK_NAME'] = 'KQUEEN__{}'.format(cluster_id)
try:
self.client.build_job(self.provision_job_name, ctx)
return (True, None)
return True, None
except Exception as e:
msg = 'Creating cluster {} failed with following reason: {}'.format(cluster_id, repr(e))
logger.error(msg)
return (False, msg)
return (None, None)
return False, msg
return None, None

def deprovision(self, **kwargs):
"""
Expand Down

0 comments on commit fcf351a

Please sign in to comment.