Skip to content

Commit

Permalink
fix detach process: would possibly even if set to False
Browse files Browse the repository at this point in the history
  • Loading branch information
schlitzered committed Jul 27, 2015
1 parent 722233e commit de392a5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
# built documents.
#
# The short X.Y version.
version = '0.0.5'
version = '0.0.6'
# The full version, including alpha/beta/rc tags.
release = '0.0.5'
release = '0.0.6'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 4 additions & 2 deletions pep3143daemon/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ def __init__(
self.umask = umask
self.uid = uid if uid else os.getuid()
self.gid = gid if gid else os.getgid()
self.detach_process = detach_process if detach_process \
else detach_required()
if detach_process is None:
self.detach_process = detach_required()
else:
self.detach_process = detach_process
self.signal_map = signal_map if signal_map else default_signal_map()
self.files_preserve = files_preserve
self.pidfile = pidfile
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='pep3143daemon',
version='0.0.5',
version='0.0.6',
description='Implementation of PEP 3143, a unix daemon',
long_description=pep3143daemon.__doc__,
packages=['pep3143daemon'],
Expand Down
22 changes: 11 additions & 11 deletions test/unit/test_Daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ def test___init__defaultargs(self):
self.assertFalse(daemon._is_open)

def test___init__customargs(self):
files_preserve = Mock()
chroot_directory = Mock()
working_directory = Mock()
umask = Mock()
files_preserve = [1, 3, 5]
chroot_directory = '/tmp/'
working_directory = '/tmp/bin/'
umask = '0022'
pidfile = Mock()
detach_process = Mock()
detach_process = False
signal_map = Mock()
uid = Mock()
gid = Mock()
prevent_core = Mock()
stdin = Mock()
stdout = Mock()
stderr = Mock()
uid = 123
gid = 123
prevent_core = True
stdin = None
stdout = None
stderr = None

daemon = pep3143daemon.daemon.DaemonContext(
files_preserve=files_preserve,
Expand Down

0 comments on commit de392a5

Please sign in to comment.