diff options
author | Andrew Lazarev <alazarev@mirantis.com> | 2015-02-11 14:47:07 -0800 |
---|---|---|
committer | Andrew Lazarev <alazarev@mirantis.com> | 2015-02-11 17:37:42 -0800 |
commit | 48df6a090b144bd08f32df4a0dd35834078b4f4c (patch) | |
tree | b9546de21a372445aa9b4a032ed9ee44dcdcc71a /saharaclient/api/clusters.py | |
parent | 18fc6a4905dc975a016b1e33eaecf6b9e759c530 (diff) | |
download | python-saharaclient-48df6a090b144bd08f32df4a0dd35834078b4f4c.tar.gz |
Removed cluster validation on client side
There is no sense in validation on client side. I believe we
don't want to have all validation logic in two places.
Also, the current validation was wrong for several reasons:
1. Wrong APIException usage (see bug description)
2. It required default_image_id for the cluster. Image could be
set in each node group individually.
3. It required cluster_configs that is not mandatory
So, the only correct check was for node_groups field, but still
I don't think that client is the right place for checking such
things. If one day we will allow clusters with no nodegroups
client should allow that without modifications.
Change-Id: I3a7bf39b102b699e8f4a1e493314412cfd26ee2e
Closes-Bug: #1420569
Diffstat (limited to 'saharaclient/api/clusters.py')
-rw-r--r-- | saharaclient/api/clusters.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/saharaclient/api/clusters.py b/saharaclient/api/clusters.py index a86c270..4130a21 100644 --- a/saharaclient/api/clusters.py +++ b/saharaclient/api/clusters.py @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import six - from saharaclient.api import base @@ -25,12 +23,6 @@ class Cluster(base.Resource): class ClusterManager(base.ResourceManager): resource_class = Cluster - def _assert_variables(self, **kwargs): - for var_name, var_value in six.iteritems(kwargs): - if var_value is None: - raise base.APIException('Cluster is missing field "%s"' % - var_name) - def create(self, name, plugin_name, hadoop_version, cluster_template_id=None, default_image_id=None, is_transient=None, description=None, cluster_configs=None, @@ -43,11 +35,6 @@ class ClusterManager(base.ResourceManager): 'hadoop_version': hadoop_version, } - if cluster_template_id is None: - self._assert_variables(default_image_id=default_image_id, - cluster_configs=cluster_configs, - node_groups=node_groups) - self._copy_if_defined(data, cluster_template_id=cluster_template_id, is_transient=is_transient, |