Eduardo has uploaded a new change for review.
Change subject: Fix fix getDomUuidFromVolumePath() ......................................................................
Fix fix getDomUuidFromVolumePath()
Change-Id: I648e6a3f4e877c8f2471e82d7064c3e5a021d4d1 Bug-Url: http://bugzilla.redhat.com/1017735 Signed-off-by: Eduardo ewarszaw@redhat.com --- M vdsm/storage/fileVolume.py 1 file changed, 5 insertions(+), 12 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/83/20783/1
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py index cf26197..c6f1702 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,11 @@
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 + sdPath = os.path.normpath(volPath).split('/images')[0] + target, sdUUID = os.path.split(sdPath) + return sdUUID
class FileVolume(volume.Volume):
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Fix fix getDomUuidFromVolumePath() ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/4368/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/5172/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/5248/ : SUCCESS
Dan Kenigsberg has posted comments on this change.
Change subject: Fix fix getDomUuidFromVolumePath() ......................................................................
Patch Set 1:
What do you think of http://gerrit.ovirt.org/20790 ?
Eduardo has posted comments on this change.
Change subject: Fix fix getDomUuidFromVolumePath() ......................................................................
Patch Set 1:
20790 was considered and discarded before send this.
This is a broken function, for broken by design callers, but this way is more robust, far as we can say robust for this wreck.
Eduardo has posted comments on this change.
Change subject: Fix fix getDomUuidFromVolumePath() ......................................................................
Patch Set 1:
As we already discussed this function and it's callers should be removed, since if you are reaching the volume you already know the SD.
Dan Kenigsberg has posted comments on this change.
Change subject: Fix fix getDomUuidFromVolumePath() ......................................................................
Patch Set 1:
Could you tell why 20790 is "less robust"? Your own patch assumes that the leading path does not have "/images" in it.
Dan Kenigsberg has posted comments on this change.
Change subject: Fix fix getDomUuidFromVolumePath() ......................................................................
Patch Set 1: Verified+1 Code-Review+2
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Fix fix getDomUuidFromVolumePath() ......................................................................
Fix fix getDomUuidFromVolumePath()
Change-Id: I648e6a3f4e877c8f2471e82d7064c3e5a021d4d1 Bug-Url: http://bugzilla.redhat.com/1017735 Signed-off-by: Eduardo ewarszaw@redhat.com Reviewed-on: http://gerrit.ovirt.org/20783 Reviewed-by: Dan Kenigsberg danken@redhat.com Tested-by: Dan Kenigsberg danken@redhat.com --- M vdsm/storage/fileVolume.py 1 file changed, 5 insertions(+), 12 deletions(-)
Approvals: Dan Kenigsberg: Verified; Looks good to me, approved
vdsm-patches@lists.fedorahosted.org