Module: check_mk
Branch: master
Commit: 4039434e7a4b57823c5f3f0c4a1ebf19ca5fcfa9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4039434e7a4b57…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 24 12:01:24 2017 +0100
Updated bug entries #2550
Change-Id: I44750f4f31cc0270636264ce6df88c049900c30e
---
.bugs/2550 | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/.bugs/2550 b/.bugs/2550
new file mode 100644
index 0000000..357de72
--- /dev/null
+++ b/.bugs/2550
@@ -0,0 +1,13 @@
+Title: omd restore deletes historic data if backup was done with -N
+Component: core
+State: open
+Date: 2017-01-24 11:59:55
+Targetversion: future
+Class: bug
+
+If you create an <tt>omd backup</tt> without historic
+data then and <tt>omd restore</tt> into an existing
+site should keep the existing historic data - even if that is
+outdated.
+
+Or shouldn't it?
Module: check_mk
Branch: master
Commit: 14566235324f143c564244012539352e340442f6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=14566235324f14…
Author: Roland Halbig <rh(a)mathias-kettner.de>
Date: Thu Jan 19 14:02:55 2017 +0100
Bugfix (workaround): Ensured that value_to_text returns strings not HTML objects.
Change-Id: I11a29d567d9d7f9155c5e98623ccbb095bba215e
---
web/htdocs/valuespec.py | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 9581bef..0eb1931 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -653,7 +653,8 @@ class EmailAddress(TextAscii):
if not value:
return TextAscii.value_to_text(self, value)
elif self._make_clickable:
- return html.render_a(value, href="mailto:%s" % value)
+ # TODO: This is a workaround for a bug. This function needs to return str objects right now.
+ return "%s" % html.render_a( HTML(value) , href="mailto:%s" % value)
else:
return value
@@ -985,7 +986,8 @@ class TextAreaUnicode(TextUnicode):
def value_to_text(self, value):
if self._monospaced:
- return html.render_pre(value, class_="ve_textarea")
+ # TODO: This is a workaround for a bug. This function needs to return str objects right now.
+ return "%s" % html.render_pre( HTML(value) , class_="ve_textarea")
else:
return html.attrencode(value).replace("\n", "<br>")
@@ -1131,8 +1133,9 @@ class ListOfStrings(ValueSpec):
return self._empty_text
if self._vertical:
- s = map(lambda v: html.render_tr(html.render_td(self._valuespec.value_to_text(v))), value)
- return html.render_table(HTML().join(s))
+ # TODO: This is a workaround for a bug. This function needs to return str objects right now.
+ s = map(lambda v: html.render_tr(html.render_td( HTML(self._valuespec.value_to_text(v)) )), value)
+ return "%s" % html.render_table(HTML().join(s))
else:
return ", ".join([ self._valuespec.value_to_text(v) for v in value ])
@@ -1307,8 +1310,9 @@ class ListOf(ValueSpec):
elif not value:
return self._text_if_empty
else:
- s = map(lambda v: html.render_tr(html.render_td(self._valuespec.value_to_text(v))), value)
- return html.render_table(HTML().join(s))
+ # TODO: This is a workaround for a bug. This function needs to return str objects right now.
+ s = map(lambda v: html.render_tr(html.render_td( HTML(self._valuespec.value_to_text(v)) )), value)
+ return "%s" % html.render_table(HTML().join(s))
def get_indexes(self, varprefix):
@@ -1430,9 +1434,10 @@ class ListOfMultiple(ValueSpec):
table_content = HTML()
for ident, val in value:
vs = self._choice_dict[ident]
+ # TODO: This is a workaround for a bug. This function needs to return str objects right now.
table_content += html.render_tr(html.render_td(vs.title())\
- + html.render_td(vs.value_to_text(val)))
- return html.render_table(table_content)
+ + html.render_td( HTML(vs.value_to_text(val)) ))
+ return "%s" % html.render_table(table_content)
def from_html_vars(self, varprefix):
value = {}
@@ -2041,7 +2046,8 @@ class ListChoice(ValueSpec):
if self._render_orientation == "horizontal":
return ", ".join(texts)
else:
- return html.render_table(html.render_tr(html.render_td(html.render_br().join(texts))))
+ # TODO: This is a workaround for a bug. This function needs to return str objects right now.
+ return "%s" % html.render_table(html.render_tr(html.render_td(html.render_br().join( map(lambda x: HTML(x), texts) ))))
#OLD: return "<table><tr><td>" + "<br>".join(texts) + "</td></tr></table>"
def from_html_vars(self, varprefix):
@@ -3509,7 +3515,8 @@ class Dictionary(ValueSpec):
s = '' if oneline else HTML()
for param, vs in elem:
if param in value:
- text = vs.value_to_text(value[param])
+ # TODO: This is a workaround for a bug. This function needs to return str objects right now.
+ text = HTML(vs.value_to_text(value[param]))
if oneline:
if param != elem[0][0]:
s += ", "
@@ -3518,7 +3525,7 @@ class Dictionary(ValueSpec):
s += html.render_tr(html.render_td("%s: " % vs.title()) + html.render_td(text))
if not oneline:
s = html.render_table(s)
- return s
+ return "%s" % s
def from_html_vars(self, varprefix):
value = {}
@@ -4126,7 +4133,8 @@ class IconSelector(ValueSpec):
return icon
def value_to_text(self, value):
- return self.render_icon(value)
+ # TODO: This is a workaround for a bug. This function needs to return str objects right now.
+ return "%s" % self.render_icon(value)
def validate_datatype(self, value, varprefix):
if value is not None and type(value) != str: