mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't fork in try with critical finally logic.
Fork executes finally section triple times.
This commit is contained in:
parent
877bc25381
commit
a50b33d96a
1 changed files with 4 additions and 2 deletions
|
@ -642,9 +642,11 @@ class Schedule(object):
|
|||
except OSError:
|
||||
log.info('Unable to remove file: {0}.'.format(fn_))
|
||||
|
||||
try:
|
||||
salt.utils.daemonize_if(self.opts)
|
||||
# Don't *BEFORE* to go into try to don't let it triple execute the finally section.
|
||||
salt.utils.daemonize_if(self.opts)
|
||||
|
||||
# TODO: Make it readable! Splt to funcs, remove nested try-except-finally sections.
|
||||
try:
|
||||
ret['pid'] = os.getpid()
|
||||
|
||||
if 'jid_include' not in data or data['jid_include']:
|
||||
|
|
Loading…
Add table
Reference in a new issue