mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Switch open()
for salt.utils.fopen()
This commit is contained in:
parent
62ec46d6dd
commit
78bc5107ee
1 changed files with 6 additions and 5 deletions
|
@ -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', '')
|
||||
|
|
Loading…
Add table
Reference in a new issue