Merge "Added validation on proxy domain for 'hiveserver' process"

This commit is contained in:
Jenkins 2014-12-22 16:14:39 +00:00 committed by Gerrit Code Review
commit 7edf86aa67

View File

@ -13,6 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from oslo.config import cfg
from sahara import exceptions as e
from sahara.i18n import _
from sahara.plugins import exceptions as ex
from sahara.plugins import utils as u
@ -21,6 +24,9 @@ from sahara.plugins.vanilla import utils as vu
from sahara.utils import general as gu
CONF = cfg.CONF
def validate_cluster_creating(pctx, cluster):
nn_count = _get_inst_count(cluster, 'namenode')
if nn_count != 1:
@ -77,6 +83,10 @@ def validate_cluster_creating(pctx, cluster):
raise ex.InvalidComponentCountException('hive', _('0 or 1'),
hive_count)
if hive_count and not CONF.use_domain_for_proxy_users:
raise e.ConfigurationError(
_("Service 'hiveserver' requires configured proxy domain."))
def validate_additional_ng_scaling(cluster, additional):
rm = vu.get_resourcemanager(cluster)