Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/31158
to review the following change.
Change subject: fileSD: include gluster in getMountsList
......................................................................
fileSD: include gluster in getMountsList
It is not exactly clear what previous change broke scanDomains but
looking at the code it seems that gluster was never explicitly handled.
This patch adds the explicit support for gluster in scanDomains fixing
the problem of missing storage domain links in the pool directory.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1116585
Change-Id: I81600a68bbea99c1079bf153cf2c105c6fe73f70
Signed-off-by: Federico Simoncelli <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/30934
Reviewed-by: Dan Kenigsberg <[email protected]>
---
M vdsm/storage/fileSD.py
1 file changed, 18 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/58/31158/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index e6b1a7c..b917301 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -57,6 +57,8 @@
# Specific stat(2) block size as defined in the man page
ST_BYTES_PER_BLOCK = 512
+_MOUNTLIST_IGNORE = ('/' + sd.BLOCKSD_DIR, '/' + sd.GLUSTERSD_DIR)
+
getProcPool = oop.getGlobalProcPool
@@ -640,13 +642,23 @@
def getMountsList(pattern="*"):
- finalPat = os.path.join(sd.StorageDomain.storage_repository,
- sd.DOMAIN_MNT_POINT, pattern)
- mntList = glob.glob(finalPat)
+ fileDomPattern = os.path.join(
+ sd.StorageDomain.storage_repository, sd.DOMAIN_MNT_POINT,
+ pattern)
+
# For pattern='*' in mixed pool (block and file domains)
- # glob will return sd.BLOCKSD_DIR among of real mount points.
- # Remove sd.BLOCKSD_DIR from glob results.
- return [mnt for mnt in mntList if not mnt.endswith('/' + sd.BLOCKSD_DIR)]
+ # glob will return sd.BLOCKSD_DIR and sd.GLUSTERSD_DIR among
+ # real mount points. Remove these directories from glob results.
+ mntList = [mnt for mnt in glob.iglob(fileDomPattern)
+ if not mnt.endswith(_MOUNTLIST_IGNORE)]
+
+ glusterDomPattern = os.path.join(
+ sd.StorageDomain.storage_repository, sd.DOMAIN_MNT_POINT,
+ sd.GLUSTERSD_DIR, pattern)
+
+ mntList.extend(glob.glob(glusterDomPattern))
+
+ return mntList
def scanDomains(pattern="*"):
--
To view, visit http://gerrit.ovirt.org/31158
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I81600a68bbea99c1079bf153cf2c105c6fe73f70
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches