summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Freudberg <jeremyfreudberg@gmail.com>2018-06-04 15:53:59 -0400
committerJeremy Freudberg <jeremyfreudberg@gmail.com>2018-06-04 15:53:59 -0400
commitaae8a863095df7432e85703d7096b561ecc3574f (patch)
tree9ddc991b6fe410497b61e22bc41b976e97e86c8d
parent4f074856b6edb59d0c6d6988e0eaf683b6a68b16 (diff)
Check node processes earlier
When creating a cluster, validate node processes as early as we can. (The config-recommending step may have some impact on validity, so we must leave that as the first call.) Note that there has been a desire mentioned to move the node process validation to occur during cluster template creation. Unfortunately the amount of refactoring needed makes the task too daunting to be completed now. Change-Id: Ib5c91e062b32a83268d178417cbc5120d4c57934
Notes
Notes (review): Code-Review+2: Telles Mota Vidal Nóbrega <tenobreg@redhat.com> Code-Review+2: Luigi Toscano <ltoscano@redhat.com> Workflow+1: Luigi Toscano <ltoscano@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 08 Jun 2018 22:26:04 +0000 Reviewed-on: https://review.openstack.org/572198 Project: openstack/sahara Branch: refs/heads/master
-rw-r--r--sahara/service/api/v10.py2
-rw-r--r--sahara/service/api/v2/clusters.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/sahara/service/api/v10.py b/sahara/service/api/v10.py
index fd182cc..656e5b0 100644
--- a/sahara/service/api/v10.py
+++ b/sahara/service/api/v10.py
@@ -125,8 +125,8 @@ def _cluster_create(values, plugin):
125 plugin.recommend_configs(cluster) 125 plugin.recommend_configs(cluster)
126 cluster = c_u.change_cluster_status( 126 cluster = c_u.change_cluster_status(
127 cluster, c_u.CLUSTER_STATUS_VALIDATING) 127 cluster, c_u.CLUSTER_STATUS_VALIDATING)
128 quotas.check_cluster(cluster)
129 plugin.validate(cluster) 128 plugin.validate(cluster)
129 quotas.check_cluster(cluster)
130 except Exception as e: 130 except Exception as e:
131 with excutils.save_and_reraise_exception(): 131 with excutils.save_and_reraise_exception():
132 c_u.change_cluster_status( 132 c_u.change_cluster_status(
diff --git a/sahara/service/api/v2/clusters.py b/sahara/service/api/v2/clusters.py
index ac04f54..7374479 100644
--- a/sahara/service/api/v2/clusters.py
+++ b/sahara/service/api/v2/clusters.py
@@ -126,8 +126,8 @@ def _cluster_create(values, plugin):
126 plugin.recommend_configs(cluster) 126 plugin.recommend_configs(cluster)
127 cluster = c_u.change_cluster_status( 127 cluster = c_u.change_cluster_status(
128 cluster, c_u.CLUSTER_STATUS_VALIDATING) 128 cluster, c_u.CLUSTER_STATUS_VALIDATING)
129 quotas.check_cluster(cluster)
130 plugin.validate(cluster) 129 plugin.validate(cluster)
130 quotas.check_cluster(cluster)
131 except Exception as e: 131 except Exception as e:
132 with excutils.save_and_reraise_exception(): 132 with excutils.save_and_reraise_exception():
133 c_u.change_cluster_status( 133 c_u.change_cluster_status(