mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
correct erroneous os.kill() statement
This commit is contained in:
parent
47cfbd40f4
commit
c54ee08917
@ -269,20 +269,20 @@ def status():
|
||||
try:
|
||||
with salt.utils.fopen(puppet.run_lockfile, 'r') as fp_:
|
||||
pid = int(fp_.read())
|
||||
os.kill(pid, 0) # raise an OSError if process doesn't exist
|
||||
except (OSError, ValueError):
|
||||
return 'Stale lockfile'
|
||||
else:
|
||||
os.kill(pid, 0)
|
||||
return 'Applying a catalog'
|
||||
|
||||
if os.path.isfile(puppet.agent_pidfile):
|
||||
try:
|
||||
with salt.utils.fopen(puppet.agent_pidfile, 'r') as fp_:
|
||||
pid = int(fp_.read())
|
||||
os.kill(pid, 0) # raise an OSError if process doesn't exist
|
||||
except (OSError, ValueError):
|
||||
return 'Stale pidfile'
|
||||
else:
|
||||
os.kill(pid, 0)
|
||||
return 'Idle daemon'
|
||||
|
||||
return 'Stopped'
|
||||
|
Loading…
Reference in New Issue
Block a user