From 630c916cd6df8cb23991159d8f95c9627dc70459 Mon Sep 17 00:00:00 2001 From: Ryan McCabe Date: Mar 09 2015 01:43:15 +0000 Subject: luci: Add support for miss_count_const Add support for setting/viewing miss_count_const in expert mode. It appears under the totem config tab. Resolves: rhbz#917761 Signed-off-by: Ryan McCabe --- diff --git a/luci/lib/ClusterConf/Totem.py b/luci/lib/ClusterConf/Totem.py index 6d9f2a7..dafc933 100644 --- a/luci/lib/ClusterConf/Totem.py +++ b/luci/lib/ClusterConf/Totem.py @@ -153,6 +153,15 @@ class Totem(TagObject): def delRRPProblemCountThreshold(self): return self.removeAttribute('rrp_problem_count_threshold') + def getMissCountConst(self): + return self.getAttribute('miss_count_const') + + def setMissCountConst(self, val): + return self.addIntegerAttribute('miss_count_const', val, (0, None)) + + def delMissCountConst(self): + return self.removeAttribute('miss_count_const') + def removeDefaults(self): if self.getJoinTimeout() == self.DEFAULTS.get('join'): self.delJoinTimeout() diff --git a/luci/templates/configure.html b/luci/templates/configure.html index 6071fcd..13ec306 100644 --- a/luci/templates/configure.html +++ b/luci/templates/configure.html @@ -182,6 +182,7 @@
+
diff --git a/luci/validation/validate_cluster_prop.py b/luci/validation/validate_cluster_prop.py index a5d0ec5..1b596e8 100644 --- a/luci/validation/validate_cluster_prop.py +++ b/luci/validation/validate_cluster_prop.py @@ -669,6 +669,15 @@ def validate_network_config(model, **kw): else: totem.delRRPProblemCountThreshold() + miss_count_const = kw.get('miss_count_const') + if miss_count_const and not miss_count_const.isspace(): + try: + totem.setMissCountConst(miss_count_const) + except: + errors.append(_('Invalid value for miss count constant: %s') % miss_count_const) + else: + totem.delMissCountConst() + totem.setSecAuth(kw.get('secauth') is not None) return (len(errors) < 1, {'errors': errors})