From 13980927a411fa9ee3715420c8d38b794d05543e Mon Sep 17 00:00:00 2001 From: Ryan McCabe Date: Jul 28 2014 12:42:09 +0000 Subject: luci: Add support for the reboot_on_pid_exhaustion attribute Add support for the reboot_on_pid_exhaustion attribute of the tag. This is shown/editable only while in expert mode. Resolves: rhbz#1117398 Signed-off-by: Ryan McCabe --- diff --git a/luci/lib/ClusterConf/Rm.py b/luci/lib/ClusterConf/Rm.py index 38cdd3a..a335aab 100644 --- a/luci/lib/ClusterConf/Rm.py +++ b/luci/lib/ClusterConf/Rm.py @@ -66,6 +66,15 @@ class Rm(TagObject): def delDisabled(self): return self.removeAttribute('disabled') + def getRebootOnPIDExhaustion(self): + return self.getBinaryAttribute('reboot_on_pid_exhaustion') + + def setRebootOnPIDExhaustion(self, val): + return self.addBinaryAttribute('reboot_on_pid_exhaustion', val, (None, '1')) + + def delRebootOnPIDExhaustion(self): + return self.removeAttribute('reboot_on_pid_exhaustion') + def removeDefaults(self): if self.getCentralProcessing() == int(self.DEFAULTS.get('central_processing')): self.delCentralProcessing() diff --git a/luci/templates/configure.html b/luci/templates/configure.html index 168af2c..f06a6ef 100644 --- a/luci/templates/configure.html +++ b/luci/templates/configure.html @@ -1018,6 +1018,11 @@ py:attrs="rm_ptr and rm_ptr.getDisabled() and {'checked':'checked'} or {}"/>
+ + +
+
diff --git a/luci/validation/validate_cluster_prop.py b/luci/validation/validate_cluster_prop.py index aaff1c4..be5fcdd 100644 --- a/luci/validation/validate_cluster_prop.py +++ b/luci/validation/validate_cluster_prop.py @@ -921,6 +921,7 @@ def validate_rm_config(model, **kw): else: rm.delTransitionThrottling() + rm.setRebootOnPIDExhaustion(kw.get('reboot_on_pid_exhaustion') is not None) rm.setCentralProcessing(kw.get('central_processing') is not None) if kw.get('rgmanager_disabled') is not None: