SIGKILL is not alwasy available use a local variable

This commit is contained in:
Daniel A. Wozniak 2019-04-29 07:56:02 +00:00 committed by Pedro Algarvio
parent 4d6b8da5a0
commit 8fdb04df0d
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -10,7 +10,6 @@
# Import python libs
from __future__ import absolute_import
import os
import signal
import shutil
import logging
@ -29,6 +28,9 @@ import salt.utils.platform
log = logging.getLogger(__name__)
SIGKILL = 9
class SyndicTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMixin):
'''
Test the salt-syndic command
@ -72,7 +74,7 @@ class SyndicTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMix
if os.path.exists(pid_path):
with salt.utils.files.fopen(pid_path) as fhr:
try:
os.kill(int(fhr.read()), signal.SIGKILL)
os.kill(int(fhr.read()), SIGKILL)
except OSError:
pass
try: