From 3d63bdc9b4cf1e305044d8f63047b47004188297 Mon Sep 17 00:00:00 2001 From: Rafik Date: Mon, 16 Jan 2017 16:49:17 +0100 Subject: [PATCH] Add HBASE MASTER processes number validation Because of the missing HBASE MASTER process number validation during cluster creation, it takes too long for sahara to raise the error too many HBASE MASTER processes. Closes-Bug: #1656869 Change-Id: Id143eb2360366443a630f65fc6261231b562417c --- sahara/plugins/cdh/validation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sahara/plugins/cdh/validation.py b/sahara/plugins/cdh/validation.py index d19cb393..961b84b1 100644 --- a/sahara/plugins/cdh/validation.py +++ b/sahara/plugins/cdh/validation.py @@ -159,13 +159,16 @@ class Validator(object): hbr_count = cls._get_inst_count(cluster, 'HBASE_REGIONSERVER') zk_count = cls._get_inst_count(cluster, 'ZOOKEEPER_SERVER') - if hbm_count >= 1: + if hbm_count == 1: if zk_count < 1: raise ex.RequiredServiceMissingException( 'ZOOKEEPER', required_by='HBASE') if hbr_count < 1: raise ex.InvalidComponentCountException( 'HBASE_REGIONSERVER', _('at least 1'), hbr_count) + elif hbm_count > 1: + raise ex.InvalidComponentCountException('HBASE_MASTER', + _('0 or 1'), hbm_count) elif hbr_count >= 1: raise ex.InvalidComponentCountException('HBASE_MASTER', _('at least 1'), hbm_count)