mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #23228 from rallytime/bp-23171
Backport #23171 to 2014.7
This commit is contained in:
commit
f20210e499
1 changed files with 4 additions and 3 deletions
|
@ -779,10 +779,11 @@ def clean_proc_dir(opts):
|
|||
with salt.utils.fopen(fn_, 'rb') as fp_:
|
||||
job = None
|
||||
try:
|
||||
job_data = fp_.read()
|
||||
if job_data:
|
||||
job = salt.payload.Serial(opts).load(fp_)
|
||||
job = salt.payload.Serial(opts).load(fp_)
|
||||
except Exception: # It's corrupted
|
||||
# Windows cannot delete an open file
|
||||
if salt.utils.is_windows():
|
||||
fp_.close()
|
||||
try:
|
||||
os.unlink(fn_)
|
||||
continue
|
||||
|
|
Loading…
Add table
Reference in a new issue