Change in vdsm[ovirt-3.5]: gluster: fix volume name parsing in getVmVolumeInfo

Federico Simoncelli fsimonce at redhat.com
Fri Jan 16 15:13:02 UTC 2015


Federico Simoncelli has uploaded a new change for review.

Change subject: gluster: fix volume name parsing in getVmVolumeInfo
......................................................................

gluster: fix volume name parsing in getVmVolumeInfo

It is permitted to use slashes '/' in gluster mount strings even
though they're prohibited in the volume name.
In order to recognize and strip them out we should use getRealPath
instead of getRemotePath that translates slashes into permitted
underscores.

It is now allowed to mount gluster volumes with slashes (serv:/volume)
and correctly identifying the volume name and its information.

Change-Id: Icfdbc573ec2aec31b78323253f8178425a07302c
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
---
M vdsm/storage/glusterVolume.py
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/37000/1

diff --git a/vdsm/storage/glusterVolume.py b/vdsm/storage/glusterVolume.py
index 647b1ec..8f701ba 100644
--- a/vdsm/storage/glusterVolume.py
+++ b/vdsm/storage/glusterVolume.py
@@ -19,10 +19,9 @@
         """
         Send info to represent Gluster volume as a network block device
         """
-        rpath = sdCache.produce(self.sdUUID).getRemotePath()
-        rpath_list = rpath.rsplit(":", 1)
-        volfileServer = rpath_list[0]
-        volname = rpath_list[1]
+        rpath = sdCache.produce(self.sdUUID).getRealPath()
+        volfileServer, volname = rpath.rsplit(":", 1)
+        volname = volname.strip('/')
 
         # Volume transport to Libvirt transport mapping
         VOLUME_TRANS_MAP = {'TCP': 'tcp', 'RDMA': 'rdma'}


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icfdbc573ec2aec31b78323253f8178425a07302c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>


More information about the vdsm-patches mailing list