From b7e6157cfab8e7f5f36fcce9ed6d197993c0b17e Mon Sep 17 00:00:00 2001 From: shnavid Date: Wed, 14 Mar 2007 13:23:04 +0000 Subject: fixed BZ#219877 (ncurses "Cancel" button makes sosreport exit) git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@92 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- src/sosreport | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/sosreport') diff --git a/src/sosreport b/src/sosreport index 3989ff0b..e5956b7c 100755 --- a/src/sosreport +++ b/src/sosreport @@ -160,10 +160,13 @@ def get_curse_options(alloptions): g = GridForm(screen, "Select Sosreport Options", 1, 10) g.add(plugCbox, 0, 0) g.add(bb, 0, 1, growx = 1) - g.runOnce() + result = g.runOnce() screen.finish() + if bb.buttonPressed(result) == "cancel": + raise "Cancelled" + for rrr in range(0, optDicCounter): optDic[rrr][3]['enabled'] = plugCbox.getEntryValue(rrr)[1] out.append((optDic[rrr])) @@ -269,7 +272,10 @@ def sosreport(): if not __cmdLineOpts__.fastoptions and not __cmdLineOpts__.usealloptions: if len(alloptions): - get_curse_options(alloptions) + try: + get_curse_options(alloptions) + except "Cancelled": + sys.exit("Exiting.") else: print "no options available for selected plugins" elif __cmdLineOpts__.fastoptions: -- cgit