Skip to content

Commit 5dd5e96

Browse files
authored
Merge pull request #1089 from mercma/master
allow stop_signal to be an integer in circus configuration file
2 parents 583e2c1 + 20690b6 commit 5dd5e96

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

circus/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def watcher_defaults():
2727
'warmup_delay': 0,
2828
'executable': None,
2929
'working_dir': None,
30+
'on_demand': False,
3031
'shell': False,
3132
'uid': None,
3233
'gid': None,
@@ -227,7 +228,7 @@ def get_config(config_file):
227228
watcher['executable'] = dget(section, 'executable', None,
228229
str)
229230
# default bool to False
230-
elif opt in ('shell', 'send_hup', 'stop_children',
231+
elif opt in ('on_demand', 'shell', 'send_hup', 'stop_children',
231232
'close_child_stderr', 'use_sockets', 'singleton',
232233
'copy_env', 'copy_path', 'close_child_stdout'):
233234
watcher[opt] = dget(section, opt, False, bool)

circus/util.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,11 @@ def to_signum(signum):
321321
'SIGKILL' - signal names with SIG prefix
322322
'SIGRTMIN+1' - signal names with offsets
323323
"""
324-
if isinstance(signum, int):
325-
return signum
324+
try:
325+
val = int(signum)
326+
return val
327+
except ValueError:
328+
pass
326329

327330
m = re.match(r'(\w+)(\+(\d+))?', signum)
328331
if m:

0 commit comments

Comments
 (0)