Ejemplo n.º 1
0
    def __useArchiveIfNeeded(self):
        
        rootBuildPath = "/usr/groups/xen/carbon/"
        rootArchivePath = "/nfs/archive/builds/carbon/"

        m = re.match("(.*%s.+?/\d+)/.*" % rootBuildPath, self.__url)
        if not m:
            return
        buildDir = m.group(1)
        archiveDir = buildDir.replace(rootBuildPath, rootArchivePath)

        if not xenrt.isUrlFetchable(buildDir) and xenrt.isUrlFetchable(archiveDir):
            self.__url = self.__url.replace(rootBuildPath, rootArchivePath)
Ejemplo n.º 2
0
 def fileExists(self, filename):
     try:
         xenrt.TEC().logverbose("fileExists %s" % filename)
         self.lock.acquire()
         fnr = FileNameResolver(filename)
         if self.__availableInCache(fnr):
             return True
         return xenrt.isUrlFetchable(fnr.url)
     finally:
         self.lock.release()