Module: check_mk
Branch: master
Commit: 1ff3d7c9d97863f0ad7518ac2c7deaba7be8bf23
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1ff3d7c9d97863…
Author: Andreas Umbreit <au(a)mathias-kettner.de>
Date: Tue Mar 7 14:33:19 2017 +0100
Combined graphs: Moving AutomaticDict from global lib to web/htdocs/metrics.py
---
lib/containers.py | 48 ------------------------------------------------
web/htdocs/metrics.py | 17 ++++++++++++++++-
2 files changed, 16 insertions(+), 49 deletions(-)
diff --git a/lib/containers.py b/lib/containers.py
deleted file mode 100644
index f8ae783..0000000
--- a/lib/containers.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/python
-# -*- encoding: utf-8; py-indent-offset: 4 -*-
-# +------------------------------------------------------------------+
-# | ____ _ _ __ __ _ __ |
-# | / ___| |__ ___ ___| | __ | \/ | |/ / |
-# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
-# | | |___| | | | __/ (__| < | | | | . \ |
-# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
-# | |
-# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
-# +------------------------------------------------------------------+
-#
-# This file is part of Check_MK.
-# The official homepage is at http://mathias-kettner.de/check_mk.
-#
-# check_mk is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation in version 2. check_mk is distributed
-# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
-# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE. See the GNU General Public License for more de-
-# tails. You should have received a copy of the GNU General Public
-# License along with GNU Make; see the file COPYING. If not, write
-# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
-# Boston, MA 02110-1301 USA.
-
-# This file contains special containers needed for data representation
-
-from collections import OrderedDict
-
-# Dictionary class with the ability of appending items like provided
-# by a list.
-class AutomaticDict(OrderedDict):
-
- def __init__(self, list_identifier = None, start_index = None):
- OrderedDict.__init__(self)
- self._list_identifier = list_identifier or "item"
- self._item_index = start_index or 0
-
- def __getitem__(self, item):
- if item in self.keys():
- return OrderedDict.__getitem__(self, item)
- else:
- return self["%s_%i" %(self._list_identifier, item)]
-
- def append(self, item):
- self["%s_%i" %(self._list_identifier, self._item_index)] = item
- self._item_index += 1
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index f300256..70ce4d6 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -43,7 +43,6 @@ from lib import *
from valuespec import *
import livestatus
from cmk.regex import regex
-from cmk.containers import AutomaticDict
try:
import simplejson as json
@@ -63,6 +62,22 @@ except ImportError:
# Datastructures and functions needed before plugins can be loaded
loaded_with_language = False
+
+# Dictionary class with the ability of appending items like provided
+# by a list.
+class AutomaticDict(OrderedDict):
+
+ def __init__(self, list_identifier = None, start_index = None):
+ OrderedDict.__init__(self)
+ self._list_identifier = list_identifier or "item"
+ self._item_index = start_index or 0
+
+
+ def append(self, item):
+ self["%s_%i" %(self._list_identifier, self._item_index)] = item
+ self._item_index += 1
+
+
def load_plugins(force):
global loaded_with_language
if loaded_with_language == current_language and not force:
Module: check_mk
Branch: master
Commit: 5be709cc92ec679050887be8c3871448151df9ec
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5be709cc92ec67…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 7 13:08:15 2017 +0100
Updated bug entries #2527
Change-Id: I7b4f460b7a4148eb5a7c4b484c90e8dffce6e8ad
---
.bugs/2527 | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/.bugs/2527 b/.bugs/2527
index b0a5b35..fd6b2dc 100644
--- a/.bugs/2527
+++ b/.bugs/2527
@@ -1,9 +1,9 @@
Title: Fix broken rule evaluation when using multiple negated hosts
Component: checks
-State: open
+Class: bug
+State: done
Date: 2016-11-09 14:46:05
Targetversion: future
-Class: bug
The functions wato.py:rule_matches_host_and_item and modules/check_mk.py:in_extraconf_hostlist
can not handle these kind of hostlist ['!heute1', '!heute', '!heute2', '@all']
@@ -16,3 +16,7 @@ Replay issue:
2) Setup hosts as mentioned in the example above
3) Navigate to "Parameters of {hostname}"
Host heute matches, Host heute1 does not match
+
+2017-03-07 13:08:12: changed state open -> done
+The problem could only be found in WATO rule analyzer. modules/check_mk.py:in_extraconf_hostlist
+is working as expected.