diff --git a/sahara/plugins/cdh/validation.py b/sahara/plugins/cdh/validation.py index ecadca71..cc10fa1b 100644 --- a/sahara/plugins/cdh/validation.py +++ b/sahara/plugins/cdh/validation.py @@ -46,12 +46,12 @@ def validate_cluster_creating(cluster): rm_count = _get_inst_count(cluster, 'RESOURCEMANAGER') if rm_count not in [0, 1]: - raise ex.InvalidComponentCountException('RESOURCEMANAGER', '0 or 1', + raise ex.InvalidComponentCountException('RESOURCEMANAGER', _('0 or 1'), rm_count) hs_count = _get_inst_count(cluster, 'JOBHISTORY') if hs_count not in [0, 1]: - raise ex.InvalidComponentCountException('JOBHISTORY', '0 or 1', + raise ex.InvalidComponentCountException('JOBHISTORY', _('0 or 1'), hs_count) if rm_count > 0 and hs_count < 1: @@ -67,7 +67,7 @@ def validate_cluster_creating(cluster): oo_count = _get_inst_count(cluster, 'OOZIE_SERVER') dn_count = _get_inst_count(cluster, 'DATANODE') if oo_count not in [0, 1]: - raise ex.InvalidComponentCountException('OOZIE_SERVER', '0 or 1', + raise ex.InvalidComponentCountException('OOZIE_SERVER', _('0 or 1'), oo_count) if oo_count == 1: diff --git a/sahara/plugins/vanilla/hadoop2/validation.py b/sahara/plugins/vanilla/hadoop2/validation.py index 1cddd0d0..af6fb6dd 100644 --- a/sahara/plugins/vanilla/hadoop2/validation.py +++ b/sahara/plugins/vanilla/hadoop2/validation.py @@ -28,17 +28,17 @@ def validate_cluster_creating(pctx, cluster): snn_count = _get_inst_count(cluster, 'secondarynamenode') if snn_count not in [0, 1]: - raise ex.InvalidComponentCountException('secondarynamenode', '0 or 1', - snn_count) + raise ex.InvalidComponentCountException('secondarynamenode', + _('0 or 1'), snn_count) rm_count = _get_inst_count(cluster, 'resourcemanager') if rm_count not in [0, 1]: - raise ex.InvalidComponentCountException('resourcemanager', '0 or 1', + raise ex.InvalidComponentCountException('resourcemanager', _('0 or 1'), rm_count) hs_count = _get_inst_count(cluster, 'historyserver') if hs_count not in [0, 1]: - raise ex.InvalidComponentCountException('historyserver', '0 or 1', + raise ex.InvalidComponentCountException('historyserver', _('0 or 1'), hs_count) nm_count = _get_inst_count(cluster, 'nodemanager') @@ -50,7 +50,7 @@ def validate_cluster_creating(pctx, cluster): oo_count = _get_inst_count(cluster, 'oozie') dn_count = _get_inst_count(cluster, 'datanode') if oo_count not in [0, 1]: - raise ex.InvalidComponentCountException('oozie', '0 or 1', oo_count) + raise ex.InvalidComponentCountException('oozie', _('0 or 1'), oo_count) if oo_count == 1: if dn_count < 1: