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

This commit is contained in:
Pedro Algarvio 2014-11-26 23:36:26 +00:00
parent bea345e720
commit d957d2e911

View file

@ -58,10 +58,11 @@ class MinionTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
# Now kill it if still running
if os.path.exists(pid_path):
try:
os.kill(int(open(pid_path).read()), signal.SIGKILL)
except OSError:
pass
with salt.utils.fopen(pid_path) as fhr:
try:
os.kill(int(fhr.read()), signal.SIGKILL)
except OSError:
pass
try:
self.assertFalse(os.path.isdir(os.path.join(config_dir, 'file:')))
self.assertIn(