当前位置: 首页>>代码示例>>Python>>正文


Python ConfigCache.getPSetTweaks方法代码示例

本文整理汇总了Python中WMCore.Cache.WMConfigCache.ConfigCache.getPSetTweaks方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigCache.getPSetTweaks方法的具体用法?Python ConfigCache.getPSetTweaks怎么用?Python ConfigCache.getPSetTweaks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WMCore.Cache.WMConfigCache.ConfigCache的用法示例。


在下文中一共展示了ConfigCache.getPSetTweaks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __call__

# 需要导入模块: from WMCore.Cache.WMConfigCache import ConfigCache [as 别名]
# 或者: from WMCore.Cache.WMConfigCache.ConfigCache import getPSetTweaks [as 别名]
    def __call__(self, wmTask):
        """
        Trip through steps, find CMSSW steps, pull in config files,
        PSet Tweaks etc

        """
        for t in wmTask.steps().nodeIterator():
            t = WMStep.WMStepHelper(t)
            stepPath = "%s/%s" % (self.workingDirectory(), t.name())

            # the CMSSW has a special case with its ConfigCache argument
            if not t.stepType() in ("CMSSW", "MulticoreCMSSW"): continue
            if getattr(t.data.application.configuration, 'configCacheUrl', None) != None:
                # main config file
                fileTarget = "%s/%s" % (
                    stepPath,
                    t.data.application.command.configuration)
                #urllib.urlretrieve(
                #    t.data.application.configuration.retrieveConfigUrl,
                #    fileTarget)
                # PSet Tweak
                cacheUrl = t.data.application.configuration.configCacheUrl
                cacheDb  = t.data.application.configuration.cacheName
                configId = t.data.application.configuration.configId
                tweakTarget = t.data.application.command.psetTweak

                configCache = ConfigCache(cacheUrl, cacheDb)
                configCache.loadByID(configId)
                configCache.saveConfigToDisk(targetFile = fileTarget)
                tweak = TweakAPI.makeTweakFromJSON(configCache.getPSetTweaks())
                if tweak:
                    tweakFile = "%s/%s" % (stepPath, tweakTarget)
                    tweak.persist(tweakFile, "json")
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:35,代码来源:CMSSWFetcher.py

示例2: testA_basicConfig

# 需要导入模块: from WMCore.Cache.WMConfigCache import ConfigCache [as 别名]
# 或者: from WMCore.Cache.WMConfigCache.ConfigCache import getPSetTweaks [as 别名]
    def testA_basicConfig(self):
        """
        _basicConfig_

        Basic configCache stuff.
        """
        PSetTweak = "Hello, I am a PSetTweak.  It's nice to meet you."

        configCache = ConfigCache(os.environ["COUCHURL"], couchDBName = 'config_test')
        configCache.createUserGroup(groupname = "testGroup", username = 'testOps')
        configCache.setPSetTweaks(PSetTweak = PSetTweak)
        configCache.save()

        configCache2 = ConfigCache(os.environ["COUCHURL"], couchDBName = 'config_test',
                                   id = configCache.getCouchID(),
                                   rev = configCache.getCouchRev())
        configCache2.loadByID(configCache.getCouchID())

        self.assertEqual(configCache2.getPSetTweaks(), PSetTweak)

        configCache2.delete()
        configCache3 = ConfigCache(os.environ["COUCHURL"], couchDBName = 'config_test',
                                   id = configCache.getCouchID(),
                                   rev = configCache.getCouchRev())

        testFlag = False

        # It should fail to load deleted documents
        try:
            configCache3.loadByID(configCache.getCouchID())
        except ConfigCacheException:
            testFlag = True

        self.assertTrue(testFlag)

        return
开发者ID:stuartw,项目名称:WMCore,代码行数:38,代码来源:WMConfigCache_t.py

示例3: showTweakFile

# 需要导入模块: from WMCore.Cache.WMConfigCache import ConfigCache [as 别名]
# 或者: from WMCore.Cache.WMConfigCache.ConfigCache import getPSetTweaks [as 别名]
 def showTweakFile(self, docId):
     """ Makes a link to the dump of the tweakfile """
     configCache = ConfigCache(self.couchUrl, self.configDBName)
     configCache.loadByID(docId)
     return str(configCache.getPSetTweaks()).replace('\n', '<br>')
开发者ID:stuartw,项目名称:WMCore,代码行数:7,代码来源:ReqMgrBrowser.py


注:本文中的WMCore.Cache.WMConfigCache.ConfigCache.getPSetTweaks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。