Nir Soffer has posted comments on this change. Change subject: fileSD: include gluster in getMountsList ......................................................................
Patch Set 2: (5 comments) Look good if I understand the directory structure correctly, can be little bit nicer. http://gerrit.ovirt.org/#/c/30934/2/vdsm/storage/fileSD.py File vdsm/storage/fileSD.py: Line 639: self.oop.utils.forceLink(tVol, tLink) Line 640: Line 641: Line 642: def getMountsList(pattern="*"): Line 643: fileDomPath = os.path.join( This is not a path but a glob pattern - use "fileDomPattern"? Line 644: sd.StorageDomain.storage_repository, sd.DOMAIN_MNT_POINT, Line 645: pattern) Line 646: Line 647: # For pattern='*' in mixed pool (block and file domains) Line 645: pattern) Line 646: Line 647: # For pattern='*' in mixed pool (block and file domains) Line 648: # glob will return sd.BLOCKSD_DIR and sd.GLUSTERSD_DIR among Line 649: # real mount points. Remove sd.BLOCKSD_DIR from glob results. "Remove sd.BLOCKSD_DIR" -> "Remove these directories" Line 650: mntList = [mnt for mnt in glob.glob(fileDomPath) Line 651: if not mnt.endswith('/' + sd.BLOCKSD_DIR) Line 652: and not mnt.endswith('/' + sd.GLUSTERSD_DIR)] Line 653: Line 648: # glob will return sd.BLOCKSD_DIR and sd.GLUSTERSD_DIR among Line 649: # real mount points. Remove sd.BLOCKSD_DIR from glob results. Line 650: mntList = [mnt for mnt in glob.glob(fileDomPath) Line 651: if not mnt.endswith('/' + sd.BLOCKSD_DIR) Line 652: and not mnt.endswith('/' + sd.GLUSTERSD_DIR)] We can simplify this a little bit: ignore = ('/' + sd.BLOCKSD_DIR, '/' + sd.GLUSTERSD_DIR) mntList = [mnt for mnt in glob.glob(fileDomPath) if not mnt.endswith(ignore)] Line 653: Line 654: glusterDomPath = os.path.join( Line 655: sd.StorageDomain.storage_repository, sd.DOMAIN_MNT_POINT, Line 656: sd.GLUSTERSD_DIR, pattern) Line 650: mntList = [mnt for mnt in glob.glob(fileDomPath) Line 651: if not mnt.endswith('/' + sd.BLOCKSD_DIR) Line 652: and not mnt.endswith('/' + sd.GLUSTERSD_DIR)] Line 653: Line 654: glusterDomPath = os.path.join( glusterDomPattern? Line 655: sd.StorageDomain.storage_repository, sd.DOMAIN_MNT_POINT, Line 656: sd.GLUSTERSD_DIR, pattern) Line 657: Line 658: mntList.extend(glob.glob(glusterDomPath)) Line 656: sd.GLUSTERSD_DIR, pattern) Line 657: Line 658: mntList.extend(glob.glob(glusterDomPath)) Line 659: Line 660: return mntList So we have this crazy directory structure? sd.DOMAIN_MNT_POINT/ file domains... sd.BLOCKSD_DIR/ block domains... sd.GLUSTERSD_DIR/ gluster domains... Line 661: Line 662: Line 663: def scanDomains(pattern="*"): Line 664: log = logging.getLogger("Storage.scanDomains") -- To view, visit http://gerrit.ovirt.org/30934 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I81600a68bbea99c1079bf153cf2c105c6fe73f70 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
