[node-patches] Change in ovirt-node[master]: Disable the option to use NFS or SSH kdump before networking

rbarry at redhat.com rbarry at redhat.com
Wed Jul 3 21:55:20 UTC 2013


Ryan Barry has uploaded a new change for review.

Change subject: Disable the option to use NFS or SSH kdump before networking
......................................................................

Disable the option to use NFS or SSH kdump before networking

As title. I wish I had the option to disable the options instead,
but urwid.RadioButton doesn't present that choice. Instead, don't
display the relevant options at all unless networking is configured.

Change-Id: I85cf0eb4084161d8117c1426010774627c7bc163
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=966343
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/setup/core/kdump_page.py
1 file changed, 27 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/23/16423/1

diff --git a/src/ovirt/node/setup/core/kdump_page.py b/src/ovirt/node/setup/core/kdump_page.py
index 7f42dce..b01f9e5 100644
--- a/src/ovirt/node/setup/core/kdump_page.py
+++ b/src/ovirt/node/setup/core/kdump_page.py
@@ -32,9 +32,13 @@
     _model = None
 
     _types = [("disabled", "Disable"),
-              ("local", "Local"),
-              ("ssh", "SSH"),
-              ("nfs", "NFS")]
+              ("local", "Local")]
+
+    net_is_configured = utils.network.NodeNetwork().is_configured()
+
+    if net_is_configured:
+        _types.extend([("ssh", "SSH"),
+                       ("nfs", "NFS")])
 
     def name(self):
         return "Kdump"
@@ -76,17 +80,26 @@
         """Describes the UI this plugin requires
         This is an ordered list of (path, widget) tuples.
         """
-        ws = [ui.Header("kdump._header", "Configure Kdump"),
-              ui.Options("kdump.type", "Type", self._types),
-              ui.Divider("divider[0]"),
-              ui.Entry("kdump.nfs_location", "NFS Location " +
-                       "(example.com:/var/crash):",
-                       align_vertical=True),
-              ui.Divider("divider[1]"),
-              ui.Entry("kdump.ssh_location", "SSH Location " +
-                       "(root at example.com):",
-                       align_vertical=True),
-              ]
+        ws = [ui.Header("kdump._header", "Configure Kdump")]
+
+        if not self.net_is_configured:
+            ws.extend([ui.Notice("network.notice",
+                                 "Networking is not configured, " +
+                                 "please configure it before NFS " +
+                                 "or SSH-based kdump"),
+                       ui.Divider("notice.divider")])
+
+        if self.net_is_configured:
+            ws.extend([ui.Options("kdump.type", "Type", self._types),
+                       ui.Divider("divider[0]"),
+                       ui.Entry("kdump.nfs_location", "NFS Location " +
+                                "(example.com:/var/crash):",
+                                align_vertical=True),
+                       ui.Divider("divider[1]"),
+                       ui.Entry("kdump.ssh_location", "SSH Location " +
+                                "(root at example.com):",
+                                align_vertical=True),
+                       ])
         page = ui.Page("page", ws)
         self.widgets.add(page)
         return page


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85cf0eb4084161d8117c1426010774627c7bc163
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list