Change in vdsm[master]: bootstrap: python-2.4 compatibility

Alon Bar-Lev alonbl at redhat.com
Thu May 16 15:50:04 UTC 2013


Alon Bar-Lev has uploaded a new change for review.

Change subject: bootstrap: python-2.4 compatibility
......................................................................

bootstrap: python-2.4 compatibility

minor changes to support python-3.4.

Change-Id: I85daedd28fdde470d5c5ef84a531b3e08af0f0f0
Signed-off-by: Alon Bar-Lev <alonbl at redhat.com>
---
M vdsm_reg/deployUtil.py.in
1 file changed, 2 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/16/14816/1

diff --git a/vdsm_reg/deployUtil.py.in b/vdsm_reg/deployUtil.py.in
index ea964fd..de0ac41 100644
--- a/vdsm_reg/deployUtil.py.in
+++ b/vdsm_reg/deployUtil.py.in
@@ -389,8 +389,7 @@
     if os.path.exists(P_VDSM_NODE_ID):
         if isOvirt():
             ovirtfunctions.ovirt_store_config(P_VDSM_NODE_ID)
-        with open(P_VDSM_NODE_ID) as f:
-            strReturn = f.readline().replace("\n", "")
+        strReturn = open(P_VDSM_NODE_ID).readline().replace("\n", "")
     else:
         strReturn = getMachineUUID()
 
@@ -1349,11 +1348,8 @@
         VDSMKEY = ts + '/keys/vdsmkey.pem'
         SPICEPKIPATH = os.path.join(ts, 'libvirt-spice')
 
-        try:
+        if not os.path.exists(SPICEPKIPATH):
             os.makedirs(SPICEPKIPATH)
-        except OSError as e:
-            if e.errno != os.errno.EEXIST:
-                raise
 
         os.chown(SPICEPKIPATH, 0, nGID)
         os.chmod(SPICEPKIPATH, 0750)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85daedd28fdde470d5c5ef84a531b3e08af0f0f0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alonbl at redhat.com>


More information about the vdsm-patches mailing list