Dan Kenigsberg has uploaded a new change for review.
Change subject: Fix fix fix getDomUuidFromVolumePath() ......................................................................
Fix fix fix getDomUuidFromVolumePath()
Change-Id: I96b71b7839666d402ec5166eefeac618685c0ab0 Bug-Url: http://bugzilla.redhat.com/1017735 Signed-off-by: Dan Kenigsberg danken@redhat.com --- M vdsm/storage/fileVolume.py 1 file changed, 3 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/20790/1
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py index cf26197..b28a8a5 100644 --- a/vdsm/storage/fileVolume.py +++ b/vdsm/storage/fileVolume.py @@ -18,13 +18,11 @@ # Refer to the README and COPYING files for full details of the license #
-from os.path import normpath import errno import os import sanlock
import storage_exception as se -from vdsm.config import config from vdsm.utils import ActionStopped, grepCmd from sdc import sdCache import outOfProcess as oop @@ -44,16 +42,9 @@
def getDomUuidFromVolumePath(volPath): - # Volume path has pattern: - # /rhev/data-center/spUUID/sdUUID/images/imgUUID/volUUID - - # sdUUID position after data-center - sdUUIDOffset = 1 - - volList = volPath.split('/') - sdUUIDPos = len(normpath(config.get('irs', 'repository')).split('/')) + \ - sdUUIDOffset - return volList[sdUUIDPos] + # fileVolume path has pattern: + # */sdUUID/images/imgUUID/volUUID + return volPath.split('/')[-4]
class FileVolume(volume.Volume):