[node-patches] Change in ovirt-node[master]: Clear KDump related fields if not relevant to the selected type
rbarry at redhat.com
rbarry at redhat.com
Mon Dec 2 17:57:15 UTC 2013
Ryan Barry has uploaded a new change for review.
Change subject: Clear KDump related fields if not relevant to the selected type
......................................................................
Clear KDump related fields if not relevant to the selected type
Previously, configuration details for kdump types which did not
match the selected one (SSH location when NFS was chosen, for
example) were shown. Hide types that aren't relevant.
Change-Id: Ibc1b77efbed69d3af463e09641a908efec82d6a3
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=989391
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/setup/core/kdump_page.py
1 file changed, 8 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/28/21928/1
diff --git a/src/ovirt/node/setup/core/kdump_page.py b/src/ovirt/node/setup/core/kdump_page.py
index 58a4038..2fc9dd9 100644
--- a/src/ovirt/node/setup/core/kdump_page.py
+++ b/src/ovirt/node/setup/core/kdump_page.py
@@ -63,6 +63,7 @@
"kdump.ssh_key": cfg["ssh_key"] or "",
"kdump.nfs_location": cfg["nfs"] or "",
}
+ self._model = model
self.logger.debug(model)
return model
@@ -130,12 +131,16 @@
for w in net_types:
if w in self.widgets:
self.widgets[w].enabled(False)
+ self.widgets[w].value("")
w = "kdump.%s_location" % changes["kdump.type"]
if w in net_types and w in self.widgets:
self.widgets[w].enabled(True)
+ self.widgets[w].value(self._model[w])
if w == "kdump.ssh_location":
self.widgets["kdump.ssh_key"].enabled(True)
+ self.widgets["kdump.ssh_key"].value(self._model[
+ "kdump.ssh_key"])
def on_merge(self, effective_changes):
"""Applies the changes to the plugins model, will do all required logic
@@ -194,14 +199,14 @@
except Exception as e:
# Restore the configuration
if saved_model["kdump.type"] == "nfs":
- model.update(saved_model["kdump.nfs_location"], None, None,
+ model.update(saved_model["kdump.nfs_location"], None, None,
None)
elif saved_model["kdump.type"] == "kdump.ssh_location":
if self.model()["kdump.ssh_key"] is not "":
- model.update(None, saved_model['kdump.ssh_location'],
+ model.update(None, saved_model['kdump.ssh_location'],
saved_model['kdump.ssh_key'], None)
else:
- model.update(None, saved_model['kdump.ssh_location'],
+ model.update(None, saved_model['kdump.ssh_location'],
None, None)
elif saved_model["kdump.type"] == "local":
model.update(None, None, None, True)
--
To view, visit http://gerrit.ovirt.org/21928
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc1b77efbed69d3af463e09641a908efec82d6a3
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