diff --git a/.gitignore b/.gitignore index afbaac5c..23ef6ae6 100644 --- a/.gitignore +++ b/.gitignore @@ -107,5 +107,5 @@ ENV/ node_modules/ # DO NOT COMMIT LOCAL CONFIG -kqueen/config_local.py +kqueen/config/local.py diff --git a/kqueen/blueprints/api/views.py b/kqueen/blueprints/api/views.py index 3ba56544..2f8d5cff 100644 --- a/kqueen/blueprints/api/views.py +++ b/kqueen/blueprints/api/views.py @@ -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 diff --git a/kqueen/engines/jenkins.py b/kqueen/engines/jenkins.py index e985608c..f93bf29e 100644 --- a/kqueen/engines/jenkins.py +++ b/kqueen/engines/jenkins.py @@ -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): """