Switch open() for salt.utils.fopen()

This commit is contained in:
Pedro Algarvio 2014-11-26 23:38:34 +00:00
parent 62ec46d6dd
commit 78bc5107ee

View file

@ -726,11 +726,12 @@ class TestDaemon(object):
except OSError as exc:
if exc.errno != 3:
raise
try:
os.kill(int(open(self.sshd_pidfile).read()), signal.SIGKILL)
except OSError as exc:
if exc.errno != 3:
raise
with salt.utils.fopen(self.sshd_pidfile) as fhr:
try:
os.kill(int(fhr.read()), signal.SIGKILL)
except OSError as exc:
if exc.errno != 3:
raise
def _exit_mockbin(self):
path = os.environ.get('PATH', '')