[node-patches] Change in ovirt-node[master]: kdump_page: Catch KeyboardInterrupt when inputting "Ctrl+c"

hadong0720 at gmail.com hadong0720 at gmail.com
Tue Sep 17 11:10:09 UTC 2013


hadong has uploaded a new change for review.

Change subject: kdump_page: Catch KeyboardInterrupt when inputting "Ctrl+c"
......................................................................

kdump_page: Catch KeyboardInterrupt when inputting "Ctrl+c"

Previously when inputting "Ctrl+c" during configuring KDump SSH,
the UI will quit.
Now try to catch KeyboardInterrupt and remove kdump configured files
instead of quitting the whole application.

Change-Id: Idefe3c12abfbd253add0c286b064eec78cb91304
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=989389
Signed-off-by: hadong <hadong0720 at gmail.com>
---
M src/ovirt/node/setup/core/kdump_page.py
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/22/19322/1

diff --git a/src/ovirt/node/setup/core/kdump_page.py b/src/ovirt/node/setup/core/kdump_page.py
index 3f87a8d..11bf092 100644
--- a/src/ovirt/node/setup/core/kdump_page.py
+++ b/src/ovirt/node/setup/core/kdump_page.py
@@ -176,6 +176,17 @@
                 progress_dialog.run()
                 console.writeln("\nPlease press any key to continue")
                 console.wait_for_keypress()
+        except KeyboardInterrupt:
+            with self.application.ui.suspended():
+                model.update(None, None, None)
+                txs = model.transaction()
+                txs()
+                console.reset()
+                console.writeln("\nDisabled kdump and Removed related " +
+                                "configuration")
+                console.writeln("\nPlease press any key to continue")
+                console.wait_for_keypress()
         except Exception as e:
             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/19322
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idefe3c12abfbd253add0c286b064eec78cb91304
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: hadong <hadong0720 at gmail.com>



More information about the node-patches mailing list