lists.checkmk.com
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
List overview
Download
Checkmk git commits
December 2018
----- 2024 -----
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
checkmk-commits@lists.checkmk.com
15 participants
342 discussions
Start a n
N
ew thread
Fixed simple modes issue: Sorting a table triggered delete action
by Lars Michelsen
Module: check_mk Branch: master Commit: fe606134b7ea3f07aa44e61036162b3259b3bd6d URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fe606134b7ea3f…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Dec 6 15:27:27 2018 +0100 Fixed simple modes issue: Sorting a table triggered delete action Change-Id: Icd8776d6e5ad6835eff89a7fcfda8a3300e83efc --- cmk/gui/plugins/wato/utils/simple_modes.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmk/gui/plugins/wato/utils/simple_modes.py b/cmk/gui/plugins/wato/utils/simple_modes.py index c59d623..c27c087 100644 --- a/cmk/gui/plugins/wato/utils/simple_modes.py +++ b/cmk/gui/plugins/wato/utils/simple_modes.py @@ -174,6 +174,9 @@ class SimpleListMode(SimpleWatoModeBase): if not html.transaction_valid(): return + if not html.has_var("_delete"): + return + confirm = wato_confirm(_("Confirm deletion"), self._delete_confirm_message()) if confirm is False: return False
5 years, 6 months
1
0
0
0
Added a TODO.
by Sven Panne
Module: check_mk Branch: master Commit: 8d7fa1dc2e9b7109514ce7dc45de8c9163f496e2 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8d7fa1dc2e9b71…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Mon Dec 10 16:44:09 2018 +0100 Added a TODO. Change-Id: I66e7c5ded0b54f92c7fb3a7d1742c144bd85bf11 --- cmk/gui/plugins/views/inventory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmk/gui/plugins/views/inventory.py b/cmk/gui/plugins/views/inventory.py index 98e4fc6..14e0a74 100644 --- a/cmk/gui/plugins/views/inventory.py +++ b/cmk/gui/plugins/views/inventory.py @@ -2118,7 +2118,7 @@ class NodeRenderer(object): return keys def _show_numeration_table(self, titles, invpath, data): - # We cannot use table here, since html.plug() does not work recursively + # TODO: Use table.open_table() below. html.open_table(class_="data") html.open_tr() for title, key in titles:
5 years, 6 months
1
0
0
0
Use table.open_table() instead of the Table constructor.
by Sven Panne
Module: check_mk Branch: master Commit: cbe4254bd5fe18f3a4ea284d5ed17ca649fd7081 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cbe4254bd5fe18…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Mon Dec 10 16:33:30 2018 +0100 Use table.open_table() instead of the Table constructor. Change-Id: Idf0f95b3ab89dd6c8df45aa1cc541e6d85436c12 --- tests/unit/cmk/gui/test_table.py | 58 ++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/tests/unit/cmk/gui/test_table.py b/tests/unit/cmk/gui/test_table.py index 3fa632d..9f61f9f 100644 --- a/tests/unit/cmk/gui/test_table.py +++ b/tests/unit/cmk/gui/test_table.py @@ -8,7 +8,6 @@ import six from cmk.gui.i18n import _ import cmk.gui.table as table -from cmk.gui.table import Table from cmk.gui.globals import html from tools import compare_html @@ -43,14 +42,13 @@ def test_basic(register_builtin_html): table_id = 0 title = " TEST " - table = Table(table_id, title, searchable=False, sortable=False) - table.row() - table.cell("A", "1") - table.cell("B", "2") - table.row() - table.cell("A", "1") - table.cell("C", "4") - table.end() + with table.open_table(table_id, title, searchable=False, sortable=False): + table.row() + table.cell("A", "1") + table.cell("B", "2") + table.row() + table.cell("A", "1") + table.cell("C", "4") written_text = "".join(html.response.flush_output()) assert read_out_simple_table(written_text) == [[u'A', u'B'], [u'1', u'2'], [u'1', u'4']] @@ -60,18 +58,17 @@ def test_plug(register_builtin_html): table_id = 0 title = " TEST " - table = Table(table_id, title, searchable=False, sortable=False) - table.row() - table.cell("A", "1") - html.write("a") - table.cell("B", "2") - html.write("b") - table.row() - table.cell("A", "1") - html.write("a") - table.cell("C", "4") - html.write("c") - table.end() + with table.open_table(table_id, title, searchable=False, sortable=False): + table.row() + table.cell("A", "1") + html.write("a") + table.cell("B", "2") + html.write("b") + table.row() + table.cell("A", "1") + html.write("a") + table.cell("C", "4") + html.write("c") written_text = "".join(html.response.flush_output()) assert read_out_simple_table(written_text) == [[u'A', u'B'], [u'1a', u'2b'], [u'1a', u'4c']] @@ -99,18 +96,15 @@ def test_nesting(register_builtin_html): table_id = 0 title = " TEST " - table = Table(table_id, title, searchable=False, sortable=False) - table.row() - table.cell("A", "1") - table.cell("B", "") - - t2 = Table(table_id+1, title+"2", searchable=False, sortable=False) - t2.row() - t2.cell("_", "+") - t2.cell("|", "-") - t2.end() + with table.open_table(table_id, title, searchable=False, sortable=False): + table.row() + table.cell("A", "1") + table.cell("B", "") + with table.open_table(table_id+1, title+"2", searchable=False, sortable=False): + table.row() + table.cell("_", "+") + table.cell("|", "-") - table.end() written_text = "".join(html.response.flush_output()) assert compare_html(written_text, '''<h3> TEST </h3> <script type="text/javascript">\nupdate_headinfo(\'1 row\');\n</script>
5 years, 6 months
1
0
0
0
Make pylint and mypy happy for test_table.
by Sven Panne
Module: check_mk Branch: master Commit: dc8a321c0ef7c301177beae57807f4a9a0ce57fb URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dc8a321c0ef7c3…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Mon Dec 10 16:10:19 2018 +0100 Make pylint and mypy happy for test_table. Change-Id: I93401b2fdfc802defb2c7792b3e5f113cf649029 --- tests/unit/cmk/gui/test_table.py | 41 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/tests/unit/cmk/gui/test_table.py b/tests/unit/cmk/gui/test_table.py index 87c80cc..3fa632d 100644 --- a/tests/unit/cmk/gui/test_table.py +++ b/tests/unit/cmk/gui/test_table.py @@ -1,22 +1,19 @@ #!/usr/bin/env python import re -from bs4 import BeautifulSoup as bs -import __builtin__ -import pytest -from tools import compare_html, gentest, compare_and_empty, bcolors +from bs4 import BeautifulSoup as bs # type: ignore +import pytest # type: ignore +import six from cmk.gui.i18n import _ -import cmk.gui.htmllib as htmlllib -import cmk.gui.http as http import cmk.gui.table as table from cmk.gui.table import Table from cmk.gui.globals import html - +from tools import compare_html def read_out_simple_table(text): - assert type(text) in [ str, unicode ] + assert isinstance(text, six.string_types) # Get the contents of the table as a list of lists data = [] for row in bs(text, 'html5lib').findAll('tr'): @@ -43,10 +40,10 @@ def read_out_csv(text, separator): def test_basic(register_builtin_html): - id = 0 + table_id = 0 title = " TEST " - table = Table(id, title, searchable=False, sortable=False) + table = Table(table_id, title, searchable=False, sortable=False) table.row() table.cell("A", "1") table.cell("B", "2") @@ -60,10 +57,10 @@ def test_basic(register_builtin_html): def test_plug(register_builtin_html): - id = 0 + table_id = 0 title = " TEST " - table = Table(id, title, searchable=False, sortable=False) + table = Table(table_id, title, searchable=False, sortable=False) table.row() table.cell("A", "1") html.write("a") @@ -88,8 +85,8 @@ def test_context(register_builtin_html): with table.open_table(table_id=table_id, searchable=False, sortable=False): for row in rows: table.row() - for i in range(len(header)): - table.cell(_(header[i]), row[i]) + for h, r in zip(header, row): + table.cell(_(h), r) written_text = "".join(html.response.flush_output()) data = read_out_simple_table(written_text) @@ -99,15 +96,15 @@ def test_context(register_builtin_html): def test_nesting(register_builtin_html): - id = 0 + table_id = 0 title = " TEST " - table = Table(id, title, searchable=False, sortable=False) + table = Table(table_id, title, searchable=False, sortable=False) table.row() table.cell("A", "1") table.cell("B", "") - t2 = Table(id+1, title+"2", searchable=False, sortable=False) + t2 = Table(table_id+1, title+"2", searchable=False, sortable=False) t2.row() t2.cell("_", "+") t2.cell("|", "-") @@ -131,14 +128,14 @@ def test_nesting(register_builtin_html): def test_nesting_context(register_builtin_html): - id = 0 + table_id = 0 title = " TEST " - with table.open_table(table_id=id, title=title, searchable=False, sortable=False): + with table.open_table(table_id=table_id, title=title, searchable=False, sortable=False): table.row() table.cell("A", "1") table.cell("B", "") - with table.open_table(id+1, title+"2", searchable=False, sortable=False): + with table.open_table(table_id+1, title+"2", searchable=False, sortable=False): table.row() table.cell("_", "+") table.cell("|", "-") @@ -190,8 +187,8 @@ def test_table_cubical(register_builtin_html, monkeypatch, sortable, searchable, output_format = output_format) for row in rows: table.row() - for i in range(len(header)): - table.cell(_(header[i]), row[i]) + for h, r in zip(header, row): + table.cell(_(h), r) table.end() # Get generated html
5 years, 6 months
1
0
0
0
Use OutputFunnel's context manager almost everywhere.
by Sven Panne
Module: check_mk Branch: master Commit: 2d9a3cbbe0ce2b7a5535d28664bec6cd160b69b6 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2d9a3cbbe0ce2b…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Mon Dec 10 13:42:44 2018 +0100 Use OutputFunnel's context manager almost everywhere. Only some table stuff left, which is a bit more tricky, to be continued... Change-Id: I8b875fabda2a90ec29eb0a73ddafe6d62c1dccdc --- cmk/gui/gui_background_job.py | 21 +++---- cmk/gui/visuals.py | 8 +-- tests/unit/cmk/gui/old/html_tests.py | 11 ++-- tests/unit/cmk/gui/test_htmllib_HTMLGenerator.py | 74 ++++++++++++------------ tests/unit/cmk/gui/test_htmllib_OutputFunnel.py | 38 +++++------- tests/unit/cmk/gui/tools.py | 39 +++++-------- 6 files changed, 83 insertions(+), 108 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=2d9a3cbbe0…
5 years, 6 months
1
0
0
0
agent_aws: Fixed wrong section header for piggyback hosts
by Simon Betz
Module: check_mk Branch: master Commit: ad64895965cf25dd5a2df3d5791cc8ecc581cd87 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ad64895965cf25…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Mon Dec 10 15:40:59 2018 +0100 agent_aws: Fixed wrong section header for piggyback hosts Change-Id: Iccf77241851ccadfef3852a4a3e88f09f9ab884c --- agents/special/agent_aws | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/special/agent_aws b/agents/special/agent_aws index 0199b2f..471f2b9 100755 --- a/agents/special/agent_aws +++ b/agents/special/agent_aws @@ -300,8 +300,8 @@ class AWSSections(object): section_header = "<<<aws_%s:cached(%s,%s)>>>\n" % (section_name, now, section_interval) for row in result: if row.piggyback_hostname: - sys.stdout.write(section_header) - sys.stdout.write("<<<aws_%s>>>\n" % section_name) + sys.stdout.write("<<<<%s>>>>\n" % row.piggyback_hostname) + sys.stdout.write(section_header) sys.stdout.write("%s\n" % json.dumps(row.content, default=_datetime_converter)) if row.piggyback_hostname: sys.stdout.write("<<<<>>>>\n")
5 years, 6 months
1
0
0
0
Fixed unused variable
by Simon Betz
Module: check_mk Branch: master Commit: b6caf431d3b8b50fefddda82451252903e421a07 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6caf431d3b8b5…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Mon Dec 10 15:34:07 2018 +0100 Fixed unused variable Change-Id: I9ddec361563183c9ae4ae4f0382f5790b7a84be5 --- cmk/gui/plugins/wato/bi.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cmk/gui/plugins/wato/bi.py b/cmk/gui/plugins/wato/bi.py index d88d60c..4377ab2 100644 --- a/cmk/gui/plugins/wato/bi.py +++ b/cmk/gui/plugins/wato/bi.py @@ -1578,7 +1578,6 @@ class ModeBIRules(ModeBI): have_this = set([]) for (pack_id, aggr_id, aggregation) in aggregations_that_use_rule.get(rule_id, []): if aggr_id not in have_this: - pack = self.pack_containing_rule(rule_id) aggr_url = html.makeuri_contextless([("mode", "bi_edit_aggregation"), ("id", aggr_id), ("pack", pack_id)]) html.a(self.aggregation_title(aggregation), href=aggr_url)
5 years, 6 months
1
0
0
0
Added cached interval to AWS agent
by Simon Betz
Module: check_mk Branch: master Commit: 561cf3abbcf97ecb2ba89e1f90107c3da38f80e3 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=561cf3abbcf97e…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Mon Dec 10 14:58:09 2018 +0100 Added cached interval to AWS agent Change-Id: I75fb76399d66f75f6a3c797c9d09e94775523e00 --- agents/special/agent_aws | 47 +++++++++++++++------- .../{aws_ec2_instances_summary => aws_ec2_summary} | 0 .../{aws_ec2_instances_summary => aws_ec2_summary} | 12 +++--- 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/agents/special/agent_aws b/agents/special/agent_aws index d0686bd..0199b2f 100755 --- a/agents/special/agent_aws +++ b/agents/special/agent_aws @@ -33,6 +33,7 @@ import datetime import json import logging import sys +import time from typing import NamedTuple, Any import boto3 @@ -111,6 +112,15 @@ class AWSSection(object): def name(self): pass + @abc.abstractproperty + def interval(self): + """ + In general the default resolution of AWS metrics is 5 min (300 sec) + The default resolution of AWS S3 metrics is 1 day (86400 sec) + We use interval property for cached section. + """ + pass + def run(self): if self._client is None: msg = "%s: No client initialized" % self.__class__.__name__ @@ -167,10 +177,14 @@ class AWSSection(object): self._received_results.setdefault(sender.name, content) -class EC2InstancesSummary(AWSSection): +class EC2Summary(AWSSection): @property def name(self): - return "ec2_instances_summary" + return "ec2_summary" + + @property + def interval(self): + return 300 def _get_raw_result(self): return self._client.describe_instances() @@ -186,10 +200,14 @@ class EC2InstancesSummary(AWSSection): return [AWSSectionResult("", content)] -class EC2Instance(AWSSection): +class EC2(AWSSection): @property def name(self): - return "ec2_instance" + return "ec2" + + @property + def interval(self): + return 300 def _get_raw_result(self): pass @@ -216,19 +234,18 @@ class AWSSections(object): cloudwatch_client = self._init_client('cloudwatch') #---distributors---------------------------------------------------- - ec2_instances_summary_distributor = ResultDistributor() + ec2_summary_distributor = ResultDistributor() #---sections-------------------------------------------------------- - ec2_instances_summary_section = EC2InstancesSummary(ec2_client, - ec2_instances_summary_distributor) - ec2_instance = EC2Instance(cloudwatch_client) + ec2_summary = EC2Summary(ec2_client, ec2_summary_distributor) + ec2 = EC2(cloudwatch_client) #---distributors registry------------------------------------------- - ec2_instances_summary_distributor.add(ec2_instance) + ec2_summary_distributor.add(ec2) #---section registry------------------------------------------------ - self._sections.append(ec2_instances_summary_section) - self._sections.append(ec2_instance) + self._sections.append(ec2_summary) + self._sections.append(ec2) def _init_client(self, client_key): try: @@ -253,7 +270,7 @@ class AWSSections(object): logging.info(e) self._exceptions.append(e) else: - self._results.setdefault(section.name, result) + self._results.setdefault((section.name, section.interval), result) if not self._results: logging.info("No results") @@ -269,7 +286,8 @@ class AWSSections(object): else: sys.stdout.write("No exceptions\n") - for section_name, result in self._results.iteritems(): + now = int(time.time()) + for (section_name, section_interval), result in self._results.iteritems(): if not result: msg = "No results of %s" % section_name logging.info(msg) @@ -279,9 +297,10 @@ class AWSSections(object): logging.info(msg) raise AWSSectionError(msg) + section_header = "<<<aws_%s:cached(%s,%s)>>>\n" % (section_name, now, section_interval) for row in result: if row.piggyback_hostname: - sys.stdout.write("<<<<%s>>>>\n" % row.piggyback_hostname) + sys.stdout.write(section_header) sys.stdout.write("<<<aws_%s>>>\n" % section_name) sys.stdout.write("%s\n" % json.dumps(row.content, default=_datetime_converter)) if row.piggyback_hostname: diff --git a/checkman/aws_ec2_instances_summary b/checkman/aws_ec2_summary similarity index 100% rename from checkman/aws_ec2_instances_summary rename to checkman/aws_ec2_summary diff --git a/checks/aws_ec2_instances_summary b/checks/aws_ec2_summary similarity index 87% rename from checks/aws_ec2_instances_summary rename to checks/aws_ec2_summary index 50637fe..c91ff8d 100644 --- a/checks/aws_ec2_instances_summary +++ b/checks/aws_ec2_summary @@ -25,12 +25,12 @@ # Boston, MA 02110-1301 USA. -def inventory_aws_ec2_instances_summary(parsed): +def inventory_aws_ec2_summary(parsed): if parsed: return [(None, {})] -def check_aws_ec2_instances_summary(item, params, parsed): +def check_aws_ec2_summary(item, params, parsed): instances_by_state = {} for reservation in parsed: for instance in reservation['Instances']: @@ -52,10 +52,10 @@ def check_aws_ec2_instances_summary(item, params, parsed): yield 0, "\n%s" % "\n".join(long_output) -check_info['aws_ec2_instances_summary'] = { +check_info['aws_ec2_summary'] = { 'parse_function': parse_aws, - 'inventory_function': inventory_aws_ec2_instances_summary, - 'check_function': check_aws_ec2_instances_summary, - 'service_description': 'AWS EC2 Instances', + 'inventory_function': inventory_aws_ec2_summary, + 'check_function': check_aws_ec2_summary, + 'service_description': 'AWS/EC2 Summary', 'includes': ['aws.include'], }
5 years, 6 months
1
0
0
0
fixed pylint warning
by Andreas Boesl
Module: check_mk Branch: master Commit: 64405da470c182a4fbc07dfad0614380136732c6 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=64405da470c182…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Mon Dec 10 15:07:58 2018 +0100 fixed pylint warning Change-Id: Ibb465d1495dd9aa84ca0396e7852798aeacae8de --- cmk/gui/plugins/wato/bi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmk/gui/plugins/wato/bi.py b/cmk/gui/plugins/wato/bi.py index 9fa5449..d88d60c 100644 --- a/cmk/gui/plugins/wato/bi.py +++ b/cmk/gui/plugins/wato/bi.py @@ -1580,7 +1580,7 @@ class ModeBIRules(ModeBI): if aggr_id not in have_this: pack = self.pack_containing_rule(rule_id) aggr_url = html.makeuri_contextless([("mode", "bi_edit_aggregation"), - ("id", aggr_id), ("pack", pack["id"])]) + ("id", aggr_id), ("pack", pack_id)]) html.a(self.aggregation_title(aggregation), href=aggr_url) html.br() have_this.add(aggr_id)
5 years, 6 months
1
0
0
0
added WK6696: BI configuration: Fixed invalid 'Used by' link,
by Andreas Boesl
fixed exception during bulk delete Message-ID: <5c0e7185.7QdN+raKzT59NkQ1%ab(a)mathias-kettner.de> User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Module: check_mk Branch: master Commit: 53c5d0c38c6fae968186f43363e4e72003632d50 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=53c5d0c38c6fae…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Mon Dec 10 14:50:20 2018 +0100 added WK6696: BI configuration: Fixed invalid 'Used by' link, fixed exception during bulk delete Change-Id: I1d83695fd3d63bfdd0255108b4682ff04d23867b --- .werks/6696 | 11 +++++++++++ cmk/gui/plugins/wato/bi.py | 11 ++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.werks/6696 b/.werks/6696 new file mode 100644 index 0000000..2aa5fb3 --- /dev/null +++ b/.werks/6696 @@ -0,0 +1,11 @@ +Title: BI configuration: Fixed invalid "Used by" link, fixed exception during bulk delete +Level: 1 +Component: bi +Class: fix +Compatible: compat +Edition: cre +State: unknown +Version: 1.6.0i1 +Date: 1544169193 + + diff --git a/cmk/gui/plugins/wato/bi.py b/cmk/gui/plugins/wato/bi.py index dfdb545..9fa5449 100644 --- a/cmk/gui/plugins/wato/bi.py +++ b/cmk/gui/plugins/wato/bi.py @@ -412,13 +412,14 @@ class BIManagement(object): def find_aggregation_rule_usages(self): aggregations_that_use_rule = {} - for pack in self._packs.itervalues(): + for pack_id, pack in self._packs.iteritems(): for aggr_id, aggregation in enumerate(pack["aggregations"]): rule_id, _description = self.rule_called_by_node(aggregation["node"]) - aggregations_that_use_rule.setdefault(rule_id, []).append((aggr_id, aggregation)) + aggregations_that_use_rule.setdefault(rule_id, []).append((pack_id, aggr_id, + aggregation)) sub_rule_ids = self._aggregation_recursive_sub_rule_ids(rule_id) for sub_rule_id in sub_rule_ids: - aggregations_that_use_rule.setdefault(sub_rule_id, []).append((aggr_id, + aggregations_that_use_rule.setdefault(sub_rule_id, []).append((pack_id, aggr_id, aggregation)) return aggregations_that_use_rule @@ -1200,7 +1201,7 @@ class ModeBIAggregations(ModeBI): return "" def _bulk_delete_after_confirm(self): - selection = map(int, self._get_selection("aggregation")) + selection = sorted(map(int, self._get_selection("aggregation"))) if selection: c = wato_confirm(_("Confirm deletion of %d aggregations") % \ len(selection), @@ -1575,7 +1576,7 @@ class ModeBIRules(ModeBI): table.text_cell(_("Nodes"), len(rule["nodes"]), css="number") table.cell(_("Used by")) have_this = set([]) - for (aggr_id, aggregation) in aggregations_that_use_rule.get(rule_id, []): + for (pack_id, aggr_id, aggregation) in aggregations_that_use_rule.get(rule_id, []): if aggr_id not in have_this: pack = self.pack_containing_rule(rule_id) aggr_url = html.makeuri_contextless([("mode", "bi_edit_aggregation"),
5 years, 6 months
1
0
0
0
← Newer
1
...
22
23
24
25
26
27
28
...
35
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Results per page:
10
25
50
100
200