def __installKIDSPatch__(self, patchInfo):
        installName = patchInfo.installName
        kidsPath = patchInfo.kidsFilePath
        seqNo = patchInfo.seqNo
        logFileName = self._logFileName
        multiBuildsList = patchInfo.multiBuildsList
        kidsInstaller = None
        """ handle patch stored as external link """
        if patchInfo.kidsSha1Path != None:
            kidsSha1 = patchInfo.kidsSha1
            (result, resultPath) = obtainKIDSPatchFileBySha1(kidsPath, kidsSha1, DEFAULT_CACHE_DIR)
            if not result:
                logger.error("Could not obtain external KIDS patch for %s" % kidsPath)
                return result
            kidsPath = resultPath  # set the KIDS Path
        """ get the right KIDS installer """
        associateFiles = patchInfo.associatedInfoFiles
        associatedGlobals = patchInfo.associatedGlobalFiles
        if patchInfo.hasCustomInstaller:
            """ use python imp module to load the source """
            logger.info("using custom installer %s" % patchInfo.customInstallerPath)
            import imp

            installerModule = imp.load_source("KIDS", patchInfo.customInstallerPath)
            from KIDS import CustomInstaller

            kidsInstaller = CustomInstaller(
                kidsPath,
                installName,
                seqNo,
                logFileName,
                multiBuildsList,
                files=associateFiles,
                globals=associatedGlobals,
            )

        else:
            kidsInstaller = KIDSInstallerFactory.createKIDSInstaller(
                kidsPath,
                installName,
                seqNo,
                logFileName,
                multiBuildsList,
                files=associateFiles,
                globals=associatedGlobals,
            )
        logger.info("Applying KIDS Patch %s" % patchInfo)
        assert kidsInstaller
        return kidsInstaller.runInstallation(self._testClient)
Exemple #2
0
  def __installKIDSPatch__(self, patchInfo):
    installName = patchInfo.installName
    kidsPath = patchInfo.kidsFilePath
    seqNo = patchInfo.seqNo
    logFileName = self._logFileName
    multiBuildsList = patchInfo.multiBuildsList
    kidsInstaller = None
    """ handle patch stored as external link """
    if patchInfo.kidsSha1Path != None:
      kidsSha1 = patchInfo.kidsSha1
      (result, resultPath) = obtainKIDSPatchFileBySha1(kidsPath,
                                                       kidsSha1,
                                                       DEFAULT_CACHE_DIR)
      if not result:
        logger.error("Could not obtain external KIDS patch for %s" % kidsPath)
        return result
      kidsPath = resultPath # set the KIDS Path
    """ get the right KIDS installer """
    associateFiles = patchInfo.associatedInfoFiles
    associatedGlobals = patchInfo.associatedGlobalFiles
    if patchInfo.hasCustomInstaller:
      """ use python imp module to load the source """
      logger.info("using custom installer %s" % patchInfo.customInstallerPath)
      import imp
      installerModule = imp.load_source("KIDS",
                                patchInfo.customInstallerPath)
      from KIDS import CustomInstaller
      kidsInstaller = CustomInstaller(kidsPath, installName,
                                      seqNo, logFileName,
                                      multiBuildsList,
                                      files=associateFiles,
                                      globals=associatedGlobals)

    else:
      kidsInstaller = KIDSInstallerFactory.createKIDSInstaller(
                            kidsPath, installName, seqNo, logFileName,
                            multiBuildsList,
                            files=associateFiles,
                            globals=associatedGlobals)
    logger.info("Applying KIDS Patch %s" % patchInfo)
    assert kidsInstaller
    return kidsInstaller.runInstallation(self._testClient)
Exemple #3
0
    def __getGlobalFileList__(self):
        globalFiles = []
        if self._globalFiles is None or len(self._globalFiles) == 0:
            return globalFiles
        for gFile in self._globalFiles:
            if isValidGlobalFileSuffix(gFile):
                globalFiles.append(gFile)
                continue
            if isValidGlobalSha1Suffix(gFile):  # external file
                sha1Sum = readSha1SumFromSha1File(gFile)
                (result,
                 path) = obtainKIDSPatchFileBySha1(gFile, sha1Sum,
                                                   DEFAULT_CACHE_DIR)
                if not result:
                    logger.error("Could not obtain global file for %s" % gFile)
                    raise Exception("Error getting global file for %s" % gFile)
                globalFiles.append(path)

        if len(globalFiles) > 0:
            logger.info("global file lists %s" % globalFiles)
        return globalFiles
  def __getGlobalFileList__(self):
    globalFiles = []
    if self._globalFiles is None or len(self._globalFiles) == 0:
      return globalFiles
    for gFile in self._globalFiles:
      if isValidGlobalFileSuffix(gFile):
        globalFiles.append(gFile)
        continue
      if isValidGlobalSha1Suffix(gFile): # external file
        sha1Sum = readSha1SumFromSha1File(gFile)
        (result, path) = obtainKIDSPatchFileBySha1(gFile,
                                                   sha1Sum,
                                                   DEFAULT_CACHE_DIR)
        if not result:
          logger.error("Could not obtain global file for %s" % gFile)
          raise Exception("Error getting global file for %s" % gFile)
        globalFiles.append(path)

    if len(globalFiles) > 0:
      logger.info("global file lists %s" % globalFiles)
    return globalFiles