Example #1
0
    def findDomainPath(sdUUID):
        for tmpSdUUID, domainPath in fileSD.scanDomains("*"):
            if tmpSdUUID == sdUUID:
                mountpoint = os.path.dirname(domainPath)
                if mount.isMounted(mountpoint):
                    return domainPath

        raise se.StorageDomainDoesNotExist(sdUUID)
Example #2
0
File: nfsSD.py Project: oVirt/vdsm
    def findDomainPath(sdUUID):
        for tmpSdUUID, domainPath in fileSD.scanDomains("*"):
            if tmpSdUUID == sdUUID:
                mountpoint = os.path.dirname(domainPath)
                if mount.isMounted(mountpoint):
                    return domainPath

        raise se.StorageDomainDoesNotExist(sdUUID)
Example #3
0
    def findDomainPath(sdUUID):
        glusterDomPath = os.path.join(sd.GLUSTERSD_DIR, "*")
        for tmpSdUUID, domainPath in fileSD.scanDomains(glusterDomPath):
            if tmpSdUUID == sdUUID:
                mountpoint = os.path.dirname(domainPath)
                if mount.isMounted(mountpoint):
                    return domainPath

        raise se.StorageDomainDoesNotExist(sdUUID)
Example #4
0
    def findDomainPath(sdUUID):
        glusterDomPath = os.path.join(sd.GLUSTERSD_DIR, "*")
        for tmpSdUUID, domainPath in fileSD.scanDomains(glusterDomPath):
            if tmpSdUUID == sdUUID:
                mountpoint = os.path.dirname(domainPath)
                if mount.isMounted(mountpoint):
                    return domainPath

        raise se.StorageDomainDoesNotExist(sdUUID)
Example #5
0
 def test_select_domains(self, scan_pattern, sd_type):
     with fake_repo() as repo, namedTemporaryDir() as tmpdir:
         file_sd = add_filesd(repo, "nfs.server:/path", str(uuid.uuid4()))
         gluster_sd = add_filesd(repo, "gluster.server:/volname",
                                 str(uuid.uuid4()), subdir=sd.GLUSTERSD_DIR)
         local_sd = add_localsd(repo, tmpdir, str(uuid.uuid4()))
         domains = {"gluster": [gluster_sd],
                    "local": [local_sd],
                    "all": [file_sd, gluster_sd, local_sd]}
         expected = set([(domain.uuid, domain.dom_dir)
                         for domain in domains[sd_type]])
         self.assertEqual(set(fileSD.scanDomains(scan_pattern)), expected)
Example #6
0
 def test_select_domains(self, scan_pattern, sd_type):
     with fake_repo() as repo, namedTemporaryDir() as tmpdir:
         file_sd = add_filesd(repo, "nfs.server:/path", str(uuid.uuid4()))
         gluster_sd = add_filesd(repo, "gluster.server:/volname",
                                 str(uuid.uuid4()), subdir=sd.GLUSTERSD_DIR)
         local_sd = add_localsd(repo, tmpdir, str(uuid.uuid4()))
         domains = {"gluster": [gluster_sd],
                    "local": [local_sd],
                    "all": [file_sd, gluster_sd, local_sd]}
         expected = set([(domain.uuid, domain.dom_dir)
                         for domain in domains[sd_type]])
         self.assertEqual(set(fileSD.scanDomains(scan_pattern)), expected)
Example #7
0
 def test_nfs_with_IPV6_address(self):
     with fake_repo() as repo:
         nfs_sd = add_filesd(repo, "[201::1]:/path", str(uuid.uuid4()))
         self.assertEqual(list(fileSD.scanDomains()),
                          [(nfs_sd.uuid, nfs_sd.dom_dir)])
Example #8
0
 def test_no_sd(self):
     with fake_repo():
         self.assertEqual(list(fileSD.scanDomains()), [])
Example #9
0
 def test_nfs_with_IPV6_address(self):
     with fake_repo() as repo:
         nfs_sd = add_filesd(repo, "[201::1]:/path", str(uuid.uuid4()))
         self.assertEqual(list(fileSD.scanDomains()),
                          [(nfs_sd.uuid, nfs_sd.dom_dir)])
Example #10
0
 def test_no_sd(self):
     with fake_repo():
         self.assertEqual(list(fileSD.scanDomains()), [])
Example #11
0
 def findDomainPath(sdUUID):
     for tmpSdUUID, domainPath in fileSD.scanDomains("_*"):
         if tmpSdUUID == sdUUID:
             return domainPath
     else:
         raise se.StorageDomainDoesNotExist(sdUUID)
Example #12
0
 def findDomainPath(sdUUID):
     for tmpSdUUID, domainPath in fileSD.scanDomains("_*"):
         if tmpSdUUID == sdUUID:
             return domainPath
     else:
         raise se.StorageDomainDoesNotExist(sdUUID)