Adam Litke has uploaded a new change for review.

Change subject: fileVolume: Fix getChildren for NFS paths
......................................................................

fileVolume: Fix getChildren for NFS paths

Since NFS-based volume paths contain ':' characters, a simple split()
when parsing grep output will be problematic.  Better use rsplit(':', 1)
so we don't chop up the path unintentionally.

example:

/rhev/data-center/mnt/192.168.2.1:_home_storage_data/aa595433-e281-4886-ab75-6863552a19b9/images/04651881-b154-49f0-a6e0-ce15c66891aa/e42398c8-2073-4a62-b8c2-fd0aac1325bf.meta:PUUID=0b491657-066a-4d21-9464-b97b693325b2

should split to:
[0] 
/rhev/data-center/mnt/192.168.2.1:_home_storage_data/aa595433-e281-4886-ab75-6863552a19b9/images/04651881-b154-49f0-a6e0-ce15c66891aa/e42398c8-2073-4a62-b8c2-fd0aac1325bf.meta
[1] PUUID=0b491657-066a-4d21-9464-b97b693325b2

but right now we get:
[0] /rhev/data-center/mnt/192.168.2.1
[1] 
_home_storage_data/aa595433-e281-4886-ab75-6863552a19b9/images/04651881-b154-49f0-a6e0-ce15c66891aa/e42398c8-2073-4a62-b8c2-fd0aac1325bf.meta
[2] PUUID=0b491657-066a-4d21-9464-b97b693325b2

Change-Id: I43030a3f1ede6434675bde866007719416da0151
Signed-off-by: Adam Litke <[email protected]>
---
M vdsm/storage/fileVolume.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/28871/1

diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index 654818e..a8e9835 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -371,7 +371,7 @@
         if matches:
             children = []
             for line in matches:
-                volMeta = os.path.basename(line.split(':')[0])
+                volMeta = os.path.basename(line.rsplit(':', 1)[0])
                 children.append(os.path.splitext(volMeta)[0])  # volUUID
         else:
             children = tuple()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43030a3f1ede6434675bde866007719416da0151
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to