Module: check_mk
Branch: master
Commit: ab176998fd2e048ca770beab9c4812ac2d203946
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ab176998fd2e04…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Oct 5 11:16:51 2017 +0200
5362 FIX Fixed possible exception on global settings page related to "diskspace
cleanup"
In 1.2.8 or older it was possible to configure "max_file_age = None" in the
etc/diskspace.conf
file. This value was not interpreted correctly by the current code which lead to an
exception
"TypeError: unsupported operand type(s) for divmod(): 'NoneType' and
'int'" on the global settings
page.
To workaround this issue, you could remove this option form the etc/diskspace.conf file.
Change-Id: If6ed76861a6596d034af4209b2c6765b2ca533ea
---
.werks/5362 | 15 +++++++++++++++
web/plugins/wato/omd_configuration.py | 3 +++
2 files changed, 18 insertions(+)
diff --git a/.werks/5362 b/.werks/5362
new file mode 100644
index 0000000..6b42b14
--- /dev/null
+++ b/.werks/5362
@@ -0,0 +1,15 @@
+Title: Fixed possible exception on global settings page related to "diskspace
cleanup"
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1507194818
+Class: fix
+
+In 1.2.8 or older it was possible to configure "max_file_age = None" in the
etc/diskspace.conf
+file. This value was not interpreted correctly by the current code which lead to an
exception
+"TypeError: unsupported operand type(s) for divmod(): 'NoneType' and
'int'" on the global settings
+page.
+
+To workaround this issue, you could remove this option form the etc/diskspace.conf file.
diff --git a/web/plugins/wato/omd_configuration.py
b/web/plugins/wato/omd_configuration.py
index c7b3937..11d7734 100644
--- a/web/plugins/wato/omd_configuration.py
+++ b/web/plugins/wato/omd_configuration.py
@@ -198,6 +198,9 @@ class ConfigDomainDiskspace(ConfigDomain):
if cleanup_settings.get("cleanup_abandoned_host_files", False) ==
None:
del cleanup_settings["cleanup_abandoned_host_files"]
+ if cleanup_settings.get("max_file_age", False) == None:
+ del cleanup_settings["max_file_age"]
+
return {
"diskspace_cleanup": cleanup_settings,
}