[node-patches] Change in ovirt-node[master]: setup: Display logging summary on status page

fabiand at fedoraproject.org fabiand at fedoraproject.org
Thu Feb 14 15:33:47 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: setup: Display logging summary on status page
......................................................................

setup: Display logging summary on status page

Previously the logging status was hardcoded.
This patch introdcues amethod to display a logging summary according to
the current configuration.

rhbz#906259

Change-Id: Icd57fb58fa3fe9530bdece7ba7b3a724db3d52a6
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/setup/status_page.py
1 file changed, 23 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/73/12073/1

diff --git a/scripts/tui/src/ovirt/node/setup/status_page.py b/scripts/tui/src/ovirt/node/setup/status_page.py
index b67348b..3537578 100644
--- a/scripts/tui/src/ovirt/node/setup/status_page.py
+++ b/scripts/tui/src/ovirt/node/setup/status_page.py
@@ -18,11 +18,12 @@
 # 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, plugins, utils
+from ovirt.node.config import defaults
+from ovirt.node.utils import security, virt, system
 import os
 import textwrap
 
-from ovirt.node import ui, plugins, utils
-from ovirt.node.utils import security, virt, system
 
 """
 Status page plugin
@@ -55,7 +56,7 @@
             "status": virt.hardware_status(),
             "networking": net_status,
             "networking.bridge": "%s %s" % (net_br, net_addrs_str),
-            "logs": "Local Only",
+            "logs": self._logging_summary(),
             "libvirt.num_guests": num_domains,
         }
 
@@ -166,6 +167,25 @@
         page.escape_key = None
         return page
 
+    def _logging_summary(self):
+        """Return a textual summary of the current log configuration
+        """
+        netconsole = defaults.Netconsole().retrieve()
+        syslog = defaults.Syslog().retrieve()
+
+        destinations = []
+
+        if syslog["server"]:
+            destinations.append("Rsyslog: %s:%s" % (syslog["server"],
+                                                    syslog["port"] or "514"))
+
+        if netconsole["server"]:
+            destinations.append("Netconsole: %s:%s" %
+                                (netconsole["server"],
+                                 netconsole["port"] or "6666"))
+
+        return ", ".join(destinations) if destinations else "Local Only"
+
 
 class HostkeyDialog(ui.Dialog):
     def __init__(self, path, title):


--
To view, visit http://gerrit.ovirt.org/12073
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd57fb58fa3fe9530bdece7ba7b3a724db3d52a6
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