Merge lp:~cboylan/boots/boots_signals into lp:boots

Proposed by Clark Boylan
Status: Merged
Merged at revision: not available
Proposed branch: lp:~cboylan/boots/boots_signals
Merge into: lp:boots
Diff against target: 30 lines (+6/-1)
1 file modified
boots/lib/console.py (+6/-1)
To merge this branch: bzr merge lp:~cboylan/boots/boots_signals
Reviewer Review Type Date Requested Status
Boots Developers Pending
Review via email: mp+21763@code.launchpad.net

Description of the change

Implemented a very simple signal handler for SIGINT.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'boots/lib/console.py'
2--- boots/lib/console.py 2010-03-15 02:03:11 +0000
3+++ boots/lib/console.py 2010-03-20 03:13:18 +0000
4@@ -25,6 +25,7 @@
5 driver of any boots client."""
6
7 import sys
8+import signal
9
10 from boots.api import api
11 from boots.api.errors import BootsError, BootsWarning, ConnectionError
12@@ -45,7 +46,6 @@
13 except ImportError:
14 # Allow the lisp lingo import to fail if Ply is not installed.
15 pass
16-import sys
17
18 # Utility function.
19 def iterable(obj):
20@@ -70,6 +70,11 @@
21
22 class Console(object):
23 def __init__(self, config, welcome_msg=None):
24+ # Setup signal handling as the first thing we do.
25+ # FIXME ^C/SIGINT should kill the current job, but that will require
26+ # some thinking.
27+ signal.signal(signal.SIGINT, signal.SIG_IGN)
28+
29 self.config = config
30 self.welcome_msg = welcome_msg
31

Subscribers

People subscribed via source and target branches

to status/vote changes: