Change in vdsm[master]: closing file after writing

ybronhei at redhat.com ybronhei at redhat.com
Fri May 31 11:15:35 UTC 2013


Yaniv Bronhaim has uploaded a new change for review.

Change subject: closing file after writing
......................................................................

closing file after writing

Change-Id: Id328e1482680959ebb55eddc28615e6d6be1545b
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
---
M vdsm/vdsm
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/54/15254/1

diff --git a/vdsm/vdsm b/vdsm/vdsm
index 96e657d..fef86db 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -83,7 +83,8 @@
 
         pidfile = constants.P_VDSM_RUN + 'vdsmd.pid'
         pid = str(os.getpid())
-        file(pidfile, 'w').write(pid + "\n")
+        with open(pidfile, 'w') as f:
+            f.write(pid + "\n")
         os.chmod(pidfile, 0664)
 
         sysname, nodename, release, version, machine = os.uname()


--
To view, visit http://gerrit.ovirt.org/15254
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id328e1482680959ebb55eddc28615e6d6be1545b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>


More information about the vdsm-patches mailing list