Module: check_mk
Branch: master
Commit: 1239298b7e7430529fa01b56f1e322061d43128e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1239298b7e7430…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jun 26 10:26:43 2015 +0200
Fixed if.include based checks were modifying global if_inventory_porttypes list during
inventory
---
checks/if.include | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/checks/if.include b/checks/if.include
index 82346a4..abceeb5 100644
--- a/checks/if.include
+++ b/checks/if.include
@@ -211,7 +211,9 @@ def inventory_if_common(info, has_nodeinfo = False):
settings = host_extra_conf_merged(g_hostname, inventory_if_rules)
uses_description = settings.get('use_desc',
if_inventory_uses_description)
uses_alias = settings.get('use_alias', if_inventory_uses_alias)
- porttypes = settings.get('porttypes', if_inventory_porttypes)
+ # Need to copy porttypes as the discovery function appends to the list below.
+ # The check must not modify the global if_inventory_porttypes configuration
variable.
+ porttypes = settings.get('porttypes', if_inventory_porttypes)[:]
portstates = settings.get('portstates', if_inventory_portstates)
match_alias = settings.get('match_alias')
match_desc = settings.get('match_desc')