Change in vdsm[master]: vm: janitorial: replace file() with open()

fromani at redhat.com fromani at redhat.com
Wed Dec 4 13:22:48 UTC 2013


Francesco Romani has uploaded a new change for review.

Change subject: vm: janitorial: replace file() with open()
......................................................................

vm: janitorial: replace file() with open()

As per docs, open() is preferred to file():
http://docs.python.org/2/library/functions.html#file

moreover, file() was removed in python3:
http://docs.python.org/release/3.0/whatsnew/3.0.html#builtins

Change-Id: I39c604b53e812a838542c94349cb64c272bea552
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/vm.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/34/22034/1

diff --git a/vdsm/vm.py b/vdsm/vm.py
index b037d3c..4be5466 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -244,7 +244,7 @@
 
             fname = self._vm.cif.prepareVolumePath(self._dstparams)
             try:
-                with file(fname, "w") as f:
+                with open(fname, "w") as f:
                     pickle.dump(self._machineParams, f)
             finally:
                 self._vm.cif.teardownVolumePath(self._dstparams)
@@ -3795,7 +3795,7 @@
             vmConfVolPath = self.cif.prepareVolumePath(vmConfVol)
             vmConf = _vmConfForMemorySnapshot()
             try:
-                with file(vmConfVolPath, "w") as f:
+                with open(vmConfVolPath, "w") as f:
                     pickle.dump(vmConf, f)
             finally:
                 self.cif.teardownVolumePath(vmConfVol)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39c604b53e812a838542c94349cb64c272bea552
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list