[node-patches] Change in ovirt-node[master]: Several syntax fixes and additional documentation

fabiand at fedoraproject.org fabiand at fedoraproject.org
Mon Mar 11 10:46:03 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: Several syntax fixes and additional documentation
......................................................................

Several syntax fixes and additional documentation

Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>

Change-Id: Ie4c566d7636f2ffa17c176557fe552aeb67df936
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/setup/logging_page.py
M scripts/tui/src/ovirt/node/ui/__init__.py
M scripts/tui/src/ovirt/node/ui/widgets.py
M scripts/tui/src/ovirt/node/utils/network.py
4 files changed, 36 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/21/12921/1

diff --git a/scripts/tui/src/ovirt/node/setup/logging_page.py b/scripts/tui/src/ovirt/node/setup/logging_page.py
index be70928..52da61a 100644
--- a/scripts/tui/src/ovirt/node/setup/logging_page.py
+++ b/scripts/tui/src/ovirt/node/setup/logging_page.py
@@ -70,25 +70,29 @@
                        "Size (KB):"),
               ui.Divider("divider[0]")
               ]
+
         if not utils.network.is_configured():
-            ws.extend([ui.Notice("network.notice","Networking is not configured, " +
-                                  "please configure it before rsyslog and/or netconsole"),
+            ws.extend([ui.Notice("network.notice",
+                                 "Networking is not configured, " +
+                                 "please configure it before rsyslog " +
+                                 "and/or netconsole"),
                        ui.Divider("notice.divider")])
+
         ws.extend([ui.Label("rsyslog.header", "RSyslog is an enhanced multi-" +
-                       "threaded syslogd"),
-                  ui.Entry("rsyslog.address", "Server Address:",
-                      enabled=utils.network.is_configured()),
-                  ui.Entry("rsyslog.port", "Server Port:",
-                      enabled=utils.network.is_configured()),
-                  ui.Divider("divider[1]"),
-                  ui.Label("netconsole.label",
-                       "Netconsole service allows a remote sys" +
-                       "log daemon to record printk() messages"),
-                  ui.Entry("netconsole.address", "Server Address:",
-                      enabled=utils.network.is_configured()),
-                  ui.Entry("netconsole.port", "Server Port:",
-                      enabled=utils.network.is_configured())
-                  ])
+                            "threaded syslogd"),
+                   ui.Entry("rsyslog.address", "Server Address:",
+                            enabled=utils.network.is_configured()),
+                   ui.Entry("rsyslog.port", "Server Port:",
+                            enabled=utils.network.is_configured()),
+                   ui.Divider("divider[1]"),
+                   ui.Label("netconsole.label",
+                            "Netconsole service allows a remote sys" +
+                            "log daemon to record printk() messages"),
+                   ui.Entry("netconsole.address", "Server Address:",
+                            enabled=utils.network.is_configured()),
+                   ui.Entry("netconsole.port", "Server Port:",
+                            enabled=utils.network.is_configured())
+                   ])
 
         page = ui.Page("page", ws)
         self.widgets.add(page)
diff --git a/scripts/tui/src/ovirt/node/ui/__init__.py b/scripts/tui/src/ovirt/node/ui/__init__.py
index cc633a7..b9a19ac 100644
--- a/scripts/tui/src/ovirt/node/ui/__init__.py
+++ b/scripts/tui/src/ovirt/node/ui/__init__.py
@@ -253,8 +253,9 @@
     def value(self, txt=None):
         return self.text(txt)
 
+
 class Notice(Label):
-    def __init__(self,path,text):
+    def __init__(self, path, text):
         super(Notice, self).__init__(path, text)
 
 
diff --git a/scripts/tui/src/ovirt/node/ui/widgets.py b/scripts/tui/src/ovirt/node/ui/widgets.py
index c79cefb..718d7d5 100644
--- a/scripts/tui/src/ovirt/node/ui/widgets.py
+++ b/scripts/tui/src/ovirt/node/ui/widgets.py
@@ -309,6 +309,7 @@
     def set_text(self, txt):
         self.text(txt)
 
+
 class Notice(Label):
     """A read only widget for notices
     """
@@ -318,6 +319,7 @@
         super(Notice, self).__init__(text)
         self._label_attrmap.set_attr_map({None: self._notice_attr})
 
+
 class Header(Label):
     """A read only widget representing a header
     """
diff --git a/scripts/tui/src/ovirt/node/utils/network.py b/scripts/tui/src/ovirt/node/utils/network.py
index 983233b..8233042 100644
--- a/scripts/tui/src/ovirt/node/utils/network.py
+++ b/scripts/tui/src/ovirt/node/utils/network.py
@@ -74,11 +74,23 @@
 
 
 def all_ifaces():
+    """A list of all network interfaces discovered by udev
+
+    Returns:
+        A list of all returned ifaces (names)
+    """
     return _query_udev_ifaces()
 
+
 def is_configured():
+    """Determin if any NIC has been configured for/by Node
+
+    Returns:
+        True if any nic has been configured
+    """
     return any(key["bootproto"] is not None for key in node_nics().values())
 
+
 def iface_information(iface, with_slow=True):
     """Retuns all system NICs (via udev)
 


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

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