From ebde2feaebf84a233fd17d8d6d965c5221ae0dbd Mon Sep 17 00:00:00 2001 From: Sergey Reshetnyak Date: Wed, 20 Aug 2014 14:13:05 +0400 Subject: [PATCH] Make Vanilla 2.3.0 plugin deprecated Change-Id: Ib6b47a5d8ef80646cf32de9c31c4b82e0b323da8 --- sahara/exceptions.py | 7 +++++++ sahara/plugins/vanilla/v2_3_0/versionhandler.py | 7 ++++++- .../tests/unit/plugins/vanilla/hadoop2/test_validation.py | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sahara/exceptions.py b/sahara/exceptions.py index c70bf6f4c2..a17da0707a 100644 --- a/sahara/exceptions.py +++ b/sahara/exceptions.py @@ -250,3 +250,10 @@ class TimeoutException(SaharaException): def __init__(self, timeout): self.message = self.message % timeout + + +class DeprecatedException(SaharaException): + code = "DEPRECATED" + + def __init__(self, message): + self.message = message diff --git a/sahara/plugins/vanilla/v2_3_0/versionhandler.py b/sahara/plugins/vanilla/v2_3_0/versionhandler.py index 0cef05387b..d8f15d611a 100644 --- a/sahara/plugins/vanilla/v2_3_0/versionhandler.py +++ b/sahara/plugins/vanilla/v2_3_0/versionhandler.py @@ -17,6 +17,8 @@ from oslo.config import cfg from sahara import conductor from sahara import context +from sahara import exceptions as ex +from sahara.i18n import _ from sahara.openstack.common import log as logging from sahara.plugins.general import utils from sahara.plugins.vanilla import abstractversionhandler as avm @@ -53,7 +55,10 @@ class VersionHandler(avm.AbstractVersionHandler): } def validate(self, cluster): - vl.validate_cluster_creating(self.pctx, cluster) + raise ex.DeprecatedException( + _("The Vanilla 2.3.0 plugin is now deprecated and will be removed" + " in the Kylo release. The Vanilla 2.4.1 plugin remains and" + " continues to be supported.")) def update_infra(self, cluster): pass diff --git a/sahara/tests/unit/plugins/vanilla/hadoop2/test_validation.py b/sahara/tests/unit/plugins/vanilla/hadoop2/test_validation.py index 96bae53ad4..a009576123 100644 --- a/sahara/tests/unit/plugins/vanilla/hadoop2/test_validation.py +++ b/sahara/tests/unit/plugins/vanilla/hadoop2/test_validation.py @@ -84,7 +84,7 @@ class ValidationTest(base.SaharaTestCase): lst.append(self.ng[i]) return tu.create_cluster("cluster1", "tenant1", "vanilla", - "2.3.0", lst, **kwargs) + "2.4.1", lst, **kwargs) def _validate_case(self, *args): cl = self._create_cluster(*args)