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
September
August
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
September 2016
----- 2024 -----
September 2024
August 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
9 participants
301 discussions
Start a n
N
ew thread
Slightly improved styling of failed notifications text in tactical overview
by Lars Michelsen
Module: check_mk Branch: master Commit: 2a0bd8ca5606cfa4c82ed88162953ab2a942c911 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a0bd8ca5606cf…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Sep 29 12:12:29 2016 +0200 Slightly improved styling of failed notifications text in tactical overview --- web/plugins/sidebar/shipped.py | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py index 688650d..ec5ae6f 100644 --- a/web/plugins/sidebar/shipped.py +++ b/web/plugins/sidebar/shipped.py @@ -589,8 +589,12 @@ def get_tactical_overview_data(extra_filter_headers): try: hstdata = sites.live().query_summed_stats(host_query) svcdata = sites.live().query_summed_stats(service_query) - notdata = notifications.load_failed_notifications(after=notifications.acknowledged_time(), - stat_only=True) + + notdata = notifications.load_failed_notifications( + after=notifications.acknowledged_time(), + stat_only=True, + extra_headers=extra_filter_headers) + if notdata is None: notdata = [0] @@ -645,28 +649,25 @@ def render_tactical_overview(extra_filter_headers="", extra_url_variables=None): html.write("</table>\n") failed_notifications = notdata[0] - if failed_notifications > 0: - view_url = html.makeuri_contextless( - [("view_name", "failed_notifications")] + extra_url_variables, filename="view.py") - content = '<a target="main" href="%s">%d failed notifications</a>' %\ - (view_url, failed_notifications) + if failed_notifications: + html.write('<div class=spacertop><div class=tacticalalert>') confirm_url = html.makeuri_contextless(extra_url_variables, filename="clear_failed_notifications.py") - content = ('<a target="main" href="%s">' - '<img src="images/button_closetimewarp.png" style="width:16px;height:16px;">' - '</a> ' % confirm_url) + content + html.icon_button(confirm_url, _("Confirm failed notifications"), "delete", target="main") + + view_url = html.makeuri_contextless( + [("view_name", "failed_notifications")] + extra_url_variables, filename="view.py") + + html.write('<a target="main" href="%s">%s</a>' % + (view_url, _("%d failed notifications") % failed_notifications)) + + html.write('</div></div>') - html.write('<div class=spacertop><div class=tacticalalert>%s</div></div>' % content) snapin_tactical_overview_styles = """ table.tacticaloverview { border-collapse: separate; - /** - * Don't use border-spacing. It is not supported by IE8 with compat mode and older IE versions. - * Better set cellspacing in HTML code. This works in all browsers. - * border-spacing: 5px 2px; - */ width: %dpx; margin-top: -7px; } @@ -682,11 +683,9 @@ table.tacticaloverview th { } table.tacticaloverview td { text-align: right; - /* border: 1px solid #123a4a; */ background-color: #6da1b8; padding: 0px; height: 14px; - /* box-shadow: 1px 0px 1px #386068; */ } table.tacticaloverview td.prob { box-shadow: 0px 0px 4px #ffd000; @@ -699,9 +698,9 @@ table.tacticaloverview td.col4 { } table.tacticaloverview a { display: block; margin-right: 2px; } div.tacticalalert { - font-weight: bold; - font-size: 14pt; - + font-size: 9pt; + line-height: 25px; + height: 25px; text-align: center; background-color: #ff5500; box-shadow: 0px 0px 4px #ffd000;
7 years, 11 months
1
0
0
0
Changed some direct file io to store file io
by Lars Michelsen
Module: check_mk Branch: master Commit: fa15881dede069d139c0b0f508d2800124cdf46f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fa15881dede069…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Sep 29 08:29:38 2016 +0200 Changed some direct file io to store file io --- web/htdocs/wato.py | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 974fd77..4069421 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -1875,26 +1875,25 @@ def rename_host_in_multisite(oldname, newname): users_changed = 0 total_changed = 0 for userid in os.listdir(config.config_dir): - if userid[0] != '.': - favpath = config.config_dir + "/" + userid + "/favorites.mk" - if os.path.exists(favpath): - try: - num_changed = 0 - favorites = eval(file(favpath).read()) - for nr, entry in enumerate(favorites): - if entry == oldname: - favorites[nr] = newname - num_changed += 1 - elif entry.startswith(oldname + ";"): - favorites[nr] = newname + ";" + entry.split(";")[1] - num_changed += 1 - if num_changed: - file(favpath, "w").write(repr(favorites) + "\n") - users_changed += 1 - total_changed += num_changed - except: - if config.debug: - raise + if userid[0] == '.': + continue + + favpath = config.config_dir + "/" + userid + "/favorites.mk" + num_changed = 0 + favorites = store.load_data_from_file(favpath, [], lock=True) + for nr, entry in enumerate(favorites): + if entry == oldname: + favorites[nr] = newname + num_changed += 1 + elif entry.startswith(oldname + ";"): + favorites[nr] = newname + ";" + entry.split(";")[1] + num_changed += 1 + + if num_changed: + store.save_data_to_file(favpath, favorites) + users_changed += 1 + total_changed += num_changed + if users_changed: return [ "favorites" ] * total_changed else: @@ -7866,11 +7865,7 @@ def mode_notifications(phase): # Show recent notifications. We can use them for rule analysis if show_backlog: - try: - backlog = eval(file(cmk.paths.var_dir + "/notify/backlog.mk").read()) - except: - backlog = [] - + backlog = store.load_data_from_file(cmk.paths.var_dir + "/notify/backlog.mk", []) if backlog: table.begin(table_id = "backlog", title = _("Recent notifications (for analysis)"), sortable=False) for nr, context in enumerate(backlog):
7 years, 11 months
1
0
0
0
Can now save data pretty printed
by Lars Michelsen
Module: check_mk Branch: master Commit: 538e08f27482b9c2eea8d0b30b066ffdf8f9b14c URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=538e08f27482b9…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Sep 29 08:47:37 2016 +0200 Can now save data pretty printed --- lib/store.py | 23 +++++++++++++++++++++-- tests/lib/test_store.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/lib/store.py b/lib/store.py index 0783282..d22544e 100644 --- a/lib/store.py +++ b/lib/store.py @@ -34,6 +34,7 @@ import os import pprint import tempfile import time +import pprint from .exceptions import MKGeneralException @@ -139,6 +140,10 @@ open = LockedOpenWithTempfile # | Loading and saving of .mk configuration files | # '----------------------------------------------------------------------' +# TODO: These functions could handle paths unicode > str conversion. This would make +# the using code again shorter in some cases. It would not have to care about +# encoding anymore. + # This function generalizes reading from a .mk configuration file. It is basically meant to # generalize the exception handling for all file IO. This function handles all those files # that are read with execfile(). @@ -207,8 +212,22 @@ def load_data_from_file(path, default=None, lock=False): # A simple wrapper for cases where you want to store a python data # structure that is then read by load_data_from_file() again -def save_data_to_file(path, data): - save_file(path, "%r\n" % data) +def save_data_to_file(path, data, pretty=True): + if pretty: + try: + formated_data = pprint.pformat(data) + except UnicodeDecodeError: + # When writing a dict with unicode keys and normal strings with garbled + # umlaut encoding pprint.pformat() fails with UnicodeDecodeError(). + # example: + # pprint.pformat({'Z\xc3\xa4ug': 'on', 'Z\xe4ug': 'on', u'Z\xc3\xa4ugx': 'on'}) + # Catch the exception and use repr() instead + formated_data = repr(data) + else: + formated_data = repr(data) + + print formated_data + save_file(path, "%s\n" % formated_data) # Saving assumes a locked destination file (usually done by loading code) diff --git a/tests/lib/test_store.py b/tests/lib/test_store.py index 1935991..e577e29 100644 --- a/tests/lib/test_store.py +++ b/tests/lib/test_store.py @@ -71,6 +71,40 @@ def test_save_data_to_file(tmpdir): assert store.load_data_from_file(path) == [2, 3] +def test_save_data_to_file_pretty(tmpdir): + f = tmpdir.join("test") + path = "%s" % f + + data = { + "asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + "1asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + "2asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + "3asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + "4asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + "5asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + } + store.save_data_to_file(path, data) + assert file(path).read().count("\n") > 4 + assert store.load_data_from_file(path) == data + + +def test_save_data_to_file_not_pretty(tmpdir): + f = tmpdir.join("test") + path = "%s" % f + + data = { + "asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + "1asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + "2asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + "3asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + "4asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + "5asdasaaaaaaaaaaaaaaaaaaaad": "asbbbbbbbbbbbbbbbbbbd", + } + store.save_data_to_file(path, data, pretty=False) + assert file(path).read().count("\n") == 1 + assert store.load_data_from_file(path) == data + + def test_acquire_lock_not_existing(tmpdir): store.aquire_lock("%s/asd" % tmpdir)
7 years, 11 months
1
0
0
0
smart agent plugin: Added some debug output
by Lars Michelsen
Module: check_mk Branch: master Commit: b42751ccce8083570270ab2039c43b65b4d5480e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b42751ccce8083…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Sep 29 09:51:13 2016 +0200 smart agent plugin: Added some debug output --- agents/plugins/smart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agents/plugins/smart b/agents/plugins/smart index e8141e7..404403f 100755 --- a/agents/plugins/smart +++ b/agents/plugins/smart @@ -93,6 +93,8 @@ if which smartctl > /dev/null 2>&1 ; then serial=AMCC_${serial}00000000000 echo "$serial=$twaminor" done` + else: + echo "tw_cli not found" >&2 fi echo '<<<smart>>>' @@ -172,6 +174,7 @@ if which smartctl > /dev/null 2>&1 ; then if [ "$MegaCli_bin" != "unknown" ]; then megaraid_info "$MegaCli_bin" fi - +else + echo "ERROR: smartctl not found" >&2 fi
7 years, 11 months
1
0
0
0
Changed a lot of code to use generalized file io
by Lars Michelsen
Module: check_mk Branch: master Commit: 2a3e030c697161fc81fb9aacbb2dc5aa0ab1db7d URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a3e030c697161…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Sep 29 09:22:42 2016 +0200 Changed a lot of code to use generalized file io --- modules/prediction.py | 2 +- web/htdocs/availability.py | 11 +++----- web/htdocs/backup.py | 14 +++++----- web/htdocs/config.py | 10 ++----- web/htdocs/guitester.py | 15 +++++------ web/htdocs/inventory.py | 15 +++-------- web/htdocs/mkeventd.py | 3 ++- web/htdocs/notify.py | 9 +++---- web/htdocs/pagetypes.py | 3 ++- web/htdocs/prediction.py | 14 +++++----- web/htdocs/sidebar.py | 17 ++++++------ web/htdocs/visuals.py | 8 +++--- web/htdocs/watolib.py | 60 +++++++++++++++++++++--------------------- web/plugins/sidebar/shipped.py | 6 ++--- web/plugins/wato/mkeventd.py | 5 ++-- 15 files changed, 84 insertions(+), 108 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=2a3e030c69…
7 years, 11 months
1
0
0
0
Fixed recently introduced error
by Lars Michelsen
Module: check_mk Branch: master Commit: 0e6a9aa175b3b24f5ad0af0e2ab137b3a1ffeb7e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0e6a9aa175b3b2…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Sep 29 10:16:54 2016 +0200 Fixed recently introduced error --- web/htdocs/werks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/htdocs/werks.py b/web/htdocs/werks.py index bd5be21..54e8ee6 100644 --- a/web/htdocs/werks.py +++ b/web/htdocs/werks.py @@ -205,7 +205,7 @@ def acknowledge_werks(werks): def save_acknowledgements(acknowledged_werks): - store.save_data_to_file(acknowledged_werks) + store.save_data_to_file(acknowledgement_path, acknowledged_werks) def acknowledge_all_werks():
7 years, 11 months
1
0
0
0
Fixed issue with "unmonitored service" view when adding own columns
by Lars Michelsen
Module: check_mk Branch: master Commit: d33c9eafd7d42bdc5b104e0a214ef162d7be3b18 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d33c9eafd7d42b…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Sep 29 11:20:01 2016 +0200 Fixed issue with "unmonitored service" view when adding own columns --- web/plugins/views/datasources.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/web/plugins/views/datasources.py b/web/plugins/views/datasources.py index 2b4c5cc..a15fb2c 100644 --- a/web/plugins/views/datasources.py +++ b/web/plugins/views/datasources.py @@ -250,9 +250,10 @@ def query_service_discovery(columns, query, only_sites, limit, all_active_filter # Hard code the discovery service filter query += "Filter: check_command = check-mk-inventory\n" - service_rows = do_query_data("GET services\n", - ["host_state", "host_has_been_checked", "long_plugin_output", "host_name"], [], [], - query, only_sites, limit, "read") + if "long_plugin_output" not in columns: + columns.append("long_plugin_output") + + service_rows = do_query_data("GET services\n", columns, [], [], query, only_sites, limit, "read") rows = [] for row in service_rows: @@ -262,15 +263,13 @@ def query_service_discovery(columns, query, only_sites, limit, all_active_filter state, check, service_description = map(lambda s: s.strip(), service_line.split(":", 2)) - rows.append({ - "site" : row["site"], - "host_name" : row["host_name"], - "host_state" : row["host_state"], - "host_has_been_checked" : row["host_has_been_checked"], - "discovery_state" : state, - "discovery_check" : check, - "discovery_service" : service_description + this_row = row.copy() + this_row.update({ + "discovery_state" : state, + "discovery_check" : check, + "discovery_service" : service_description }) + rows.append(this_row) return rows
7 years, 11 months
1
0
0
0
User files are now also saved with store.save_data_to_file()
by Lars Michelsen
Module: check_mk Branch: master Commit: f250e39c296ba514b5ffa1d5b12d3d59d8e55df2 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f250e39c296ba5…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Sep 29 09:27:53 2016 +0200 User files are now also saved with store.save_data_to_file() --- lib/store.py | 1 - web/htdocs/config.py | 15 ++------------- web/htdocs/html_mod_python.py | 4 ++-- web/htdocs/htmllib.py | 6 +++--- web/htdocs/views.py | 2 +- web/htdocs/visuals.py | 2 +- 6 files changed, 9 insertions(+), 21 deletions(-) diff --git a/lib/store.py b/lib/store.py index d22544e..98a76b8 100644 --- a/lib/store.py +++ b/lib/store.py @@ -226,7 +226,6 @@ def save_data_to_file(path, data, pretty=True): else: formated_data = repr(data) - print formated_data save_file(path, "%s\n" % formated_data) diff --git a/web/htdocs/config.py b/web/htdocs/config.py index db4106a..f046801 100644 --- a/web/htdocs/config.py +++ b/web/htdocs/config.py @@ -442,25 +442,14 @@ def load_user_file(name, deflt, lock = False): return store.load_data_from_file(path, deflt, lock) -def save_user_file(name, content, unlock=False, user=None): +def save_user_file(name, data, user=None): if user == None: user = user_id dirname = config_dir + "/" + user.encode("utf-8") make_nagios_directory(dirname) path = dirname + "/" + name + ".mk" + store.save_data_to_file(path, data) - try: - try: - write_settings_file(path + ".new", content) - os.rename(path + ".new", path) - except Exception, e: - if debug: - raise - raise MKConfigError(_("Cannot save %s options for user <b>%s</b> into <b>%s</b>: %s") % \ - (name, user, path, e)) - finally: - if unlock: - release_lock(path) def user_file_modified(name): if user_confdir == None: diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py index 35750fa..d30c9dc 100644 --- a/web/htdocs/html_mod_python.py +++ b/web/htdocs/html_mod_python.py @@ -280,9 +280,9 @@ class html_mod_python(htmllib.html): def load_transids(self, lock = False): return config.load_user_file("transids", [], lock) - def save_transids(self, used_ids, unlock = False): + def save_transids(self, used_ids): if config.user_id: - config.save_user_file("transids", used_ids, unlock) + config.save_user_file("transids", used_ids) def save_tree_states(self): config.save_user_file("treestates", self.treestates) diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index 3bad574..4909e59 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -1836,7 +1836,7 @@ class html(object): timestamp = valid_id.split("/")[0] if now - int(timestamp) < 86400: # one day cleared_ids.append(valid_id) - self.save_transids((cleared_ids[-20:] + self.new_transids), unlock = True) + self.save_transids((cleared_ids[-20:] + self.new_transids)) # Remove the used transid from the list of valid ones @@ -1846,7 +1846,7 @@ class html(object): valid_ids.remove(used_id) except ValueError: return - self.save_transids(valid_ids, unlock = True) + self.save_transids(valid_ids) # Checks, if the current transaction is valid, i.e. in case of @@ -1911,7 +1911,7 @@ class html(object): raise NotImplementedError() - def save_transids(self, used_ids, unlock=False): + def save_transids(self, used_ids): raise NotImplementedError() diff --git a/web/htdocs/views.py b/web/htdocs/views.py index 08c4797..1d0a5dd 100644 --- a/web/htdocs/views.py +++ b/web/htdocs/views.py @@ -438,7 +438,7 @@ class PainterOptions(object): def save_to_config(self): vo = config.load_user_file("viewoptions", {}, lock=True) vo[self._view_name] = self._options - config.save_user_file("viewoptions", vo, unlock=True) + config.save_user_file("viewoptions", vo) def update_from_url(self, view): diff --git a/web/htdocs/visuals.py b/web/htdocs/visuals.py index 3c48acc..79bb7d6 100644 --- a/web/htdocs/visuals.py +++ b/web/htdocs/visuals.py @@ -105,7 +105,7 @@ def save(what, visuals, user_id = None): for (owner_id, name), visual in visuals.items(): if user_id == owner_id: uservisuals[name] = visual - config.save_user_file('user_' + what, uservisuals, user = user_id, unlock=True) + config.save_user_file('user_' + what, uservisuals, user = user_id) # FIXME: Currently all user visual files of this type are locked. We could optimize # this not to lock all files but only lock the files the user is about to modify.
7 years, 11 months
1
0
0
0
ast module is now available everywhere
by Lars Michelsen
Module: check_mk Branch: master Commit: 3e89f64d71d92fe70f67a93c428c484299796a6c URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e89f64d71d92f…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Sep 28 17:06:54 2016 +0200 ast module is now available everywhere --- modules/packaging.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/modules/packaging.py b/modules/packaging.py index 3b53289..3f40c4b 100644 --- a/modules/packaging.py +++ b/modules/packaging.py @@ -24,6 +24,7 @@ # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. +import ast import pprint, tarfile import cmk.tty as tty @@ -640,12 +641,4 @@ def all_package_names(): def parse_package_info(python_string): - try: - # ast.literal_eval does not execute any code, just reads in passive - # data structures, so it is safe. But: not available on all supported - # Python versions - import ast - except: - return eval(python_string) - return ast.literal_eval(python_string)
7 years, 11 months
1
0
0
0
Removed unused included function
by Lars Michelsen
Module: check_mk Branch: master Commit: ac4db0e06d051353e0b9f5084f03436e3a7e4930 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ac4db0e06d0513…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Sep 28 17:07:46 2016 +0200 Removed unused included function --- web/htdocs/notifications.py | 1 - 1 file changed, 1 deletion(-) diff --git a/web/htdocs/notifications.py b/web/htdocs/notifications.py index 2388506..a84fedd 100644 --- a/web/htdocs/notifications.py +++ b/web/htdocs/notifications.py @@ -24,7 +24,6 @@ # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. -from ast import literal_eval import config import lib import errno
7 years, 11 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
31
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
Results per page:
10
25
50
100
200