mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Avoid traceback when bogus value in pidfile
This commit is contained in:
parent
465cacad83
commit
d66f3a98d7
1 changed files with 5 additions and 5 deletions
|
@ -142,12 +142,12 @@ def get_pidfile(pidfile):
|
|||
'''
|
||||
Return the pid from a pidfile as an integer
|
||||
'''
|
||||
with salt.utils.fopen(pidfile) as pdf:
|
||||
pid = pdf.read()
|
||||
if pid:
|
||||
try:
|
||||
with salt.utils.fopen(pidfile) as pdf:
|
||||
pid = pdf.read().strip()
|
||||
return int(pid)
|
||||
else:
|
||||
return
|
||||
except (OSError, IOError, TypeError, ValueError):
|
||||
return None
|
||||
|
||||
|
||||
def clean_proc(proc, wait_for_kill=10):
|
||||
|
|
Loading…
Add table
Reference in a new issue