summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/service
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/service')
-rw-r--r--test/integration/targets/service/files/ansible_test_service.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/integration/targets/service/files/ansible_test_service.py b/test/integration/targets/service/files/ansible_test_service.py
index 6bf404cad4..9104572cb7 100644
--- a/test/integration/targets/service/files/ansible_test_service.py
+++ b/test/integration/targets/service/files/ansible_test_service.py
@@ -38,9 +38,8 @@ def createDaemon():
os.chdir(WORKDIR)
os.umask(UMASK)
else:
- f = open('/var/run/ansible_test_service.pid', 'w')
- f.write("%d\n" % pid)
- f.close()
+ with open('/var/run/ansible_test_service.pid', 'w') as f:
+ f.write("%d\n" % pid)
os._exit(0)
else:
os._exit(0)