Ejemplo n.º 1
0
    def __installPatch__(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) = obtainKIDSBuildFileBySha1(kidsPath, kidsSha1,
                                                     DEFAULT_CACHE_DIR)
            if not result:
                logger.error("Could not obtain external 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,
                                            duz=self._duz)

        else:
            kidsInstaller = KIDSInstallerFactory.createKIDSInstaller(
                kidsPath,
                installName,
                seqNo,
                logFileName,
                multiBuildsList,
                files=associateFiles,
                globals=associatedGlobals,
                duz=self._duz)
        logger.info("Applying Patch %s" % patchInfo)
        assert kidsInstaller
        return kidsInstaller.runInstallation(self._testClient,
                                             self._testClient2)
Ejemplo n.º 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)