[node-patches] Change in ovirt-node[master]: Restore the values in /etc/default/ovirt when kdump config f...

rbarry at redhat.com rbarry at redhat.com
Mon Oct 28 16:08:12 UTC 2013


Ryan Barry has uploaded a new change for review.

Change subject: Restore the values in /etc/default/ovirt when kdump config fails
......................................................................

Restore the values in /etc/default/ovirt when kdump config fails

Previously, we restored kdump.conf, but did not restore the proper
entries in /etc/default/ovirt when configuration changes did not
apply cleanly. Do so.

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/28/20628/1

diff --git a/src/ovirt/node/setup/core/kdump_page.py b/src/ovirt/node/setup/core/kdump_page.py
index 0e15e25..8c77a4f 100644
--- a/src/ovirt/node/setup/core/kdump_page.py
+++ b/src/ovirt/node/setup/core/kdump_page.py
@@ -142,6 +142,7 @@
         self.logger.debug("Saving kdump page")
         changes = Changeset(self.pending_changes(False))
         effective_model = Changeset(self.model())
+        saved_model = self.model()
         effective_model.update(effective_changes)
 
         self.logger.debug("Changes: %s" % changes)
@@ -188,6 +189,21 @@
                 console.writeln("\nPlease press any key to continue")
                 console.wait_for_keypress()
         except Exception as e:
+            # Restore the configuration
+            if saved_model["kdump.type"] == "nfs":
+                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'], 
+                                 saved_model['kdump.ssh_key'], None)
+                else:
+                    model.update(None, saved_model['kdump.ssh_location'], 
+                                 None, None)
+            elif saved_model["kdump.type"] == "local":
+                model.update(None, None, None, True)
+            else:
+                model.update(None, None, None, None)
             self.logger.exception("Exception while configuring kdump")
             return InfoDialog("dialog.info", _("An error occurred"), e.message)
         return self.ui_content()


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

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