[node-patches] Change in ovirt-node[master]: setup: Add logfiles to support page
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Mon Jan 28 17:34:52 UTC 2013
Fabian Deutsch has uploaded a new change for review.
Change subject: setup: Add logfiles to support page
......................................................................
setup: Add logfiles to support page
Change-Id: I5f1c0a7fb175153d98b346d74cac6bb345f048c1
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/setup/support_page.py
1 file changed, 28 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/76/11476/1
diff --git a/scripts/tui/src/ovirt/node/setup/support_page.py b/scripts/tui/src/ovirt/node/setup/support_page.py
index 3dfa432..5794641 100644
--- a/scripts/tui/src/ovirt/node/setup/support_page.py
+++ b/scripts/tui/src/ovirt/node/setup/support_page.py
@@ -18,8 +18,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA. A copy of the GNU General Public License is
# also available at http://www.gnu.org/copyleft/gpl.html.
+from ovirt.node import ui, utils
from ovirt.node.plugins import NodePlugin
-from ovirt.node import ui
"""
A plugin for a support page
@@ -43,10 +43,19 @@
return False
def ui_content(self):
- ws = [ui.Label("features.info", "FIXME Support info")]
+ ws = [ui.Header("header[0]", "Support Info"),
+ ui.Label("support.info", "FIXME Support info"),
+ ui.Divider("divider[0]"),
+ ui.Table("support.logfile", "Logfiles", "Available Logfiles",
+ self.__debugfiles_to_offer()),
+
+ ui.Header("header[1]", "(Data:)"),
+ ui.Label("support.contents", "")
+ ]
page = ui.Page("page", ws)
page.buttons = []
+ self.widgets.add(page)
return page
def model(self):
@@ -56,7 +65,23 @@
return {}
def on_change(self, changes):
- pass
+ if changes.contains_any(["support.logfile"]):
+ logfile = changes["support.logfile"]
+ if logfile == "ui":
+ content = utils.fs.get_contents("/tmp/ovirt.debug.log")
+
+ if logfile == "messages":
+ content = utils.fs.get_contents("/var/log/messages")
+
+ if logfile == "dmesg":
+ content = utils.process.check_output("dmesg")
+
+ self.widgets["support.contents"].value(content)
def on_merge(self, changes):
pass
+
+ def __debugfiles_to_offer(self):
+ return [("ui", "Node Debug Log"),
+ ("dmesg", "dmesg"),
+ ("messages", "/var/log/messages")]
\ No newline at end of file
--
To view, visit http://gerrit.ovirt.org/11476
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f1c0a7fb175153d98b346d74cac6bb345f048c1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>
More information about the node-patches
mailing list