correct erroneous os.kill() statement

This commit is contained in:
Marc Fournier 2014-06-02 08:59:04 +02:00
parent 47cfbd40f4
commit c54ee08917

View File

@ -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'