本文整理汇总了Python中WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement.updateSoftware方法的典型用法代码示例。如果您正苦于以下问题:Python SoftwareManagement.updateSoftware方法的具体用法?Python SoftwareManagement.updateSoftware怎么用?Python SoftwareManagement.updateSoftware使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement
的用法示例。
在下文中一共展示了SoftwareManagement.updateSoftware方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testA_SoftwareManagement
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import updateSoftware [as 别名]
def testA_SoftwareManagement(self):
"""
_SoftwareManagement_
Test the SoftwareManagement code
"""
self.assertEqual(SoftwareManagement.listSoftware(), {})
softwareVersions = ReqMgrWebTools.allScramArchsAndVersions()
ReqMgrWebTools.updateScramArchsAndCMSSWVersions()
result = SoftwareManagement.listSoftware()
for scramArch in result.keys():
self.assertEqual(set(result[scramArch]), set(softwareVersions[scramArch]))
# Now for each scramArch insert a blank set
# Because of the way that updateSoftware works, this interprets a blank list
# as telling it that no softwareVersions are available.
# It deletes every software version it is not handed, so it should give nothing out.
for scramArch in result.keys():
SoftwareManagement.updateSoftware(softwareNames = [], scramArch = scramArch)
self.assertEqual(SoftwareManagement.listSoftware(), {})
from WMCore.HTTPFrontEnd.RequestManager import Admin
setattr(self.config, 'database', self.testInit.coreConfig.CoreDatabase)
self.config.section_('templates')
self.config.section_('html')
admin = Admin.Admin(self.config)
ReqMgrWebTools.updateScramArchsAndCMSSWVersions()
self.assertTrue('slc5_amd64_gcc434' in admin.scramArchs())
return
示例2: updateScramArchsAndCMSSWVersions
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import updateSoftware [as 别名]
def updateScramArchsAndCMSSWVersions():
"""
_updateScramArchsAndCMSSWVersions_
Update both the scramArchs and their associated software versions to
the current tag collector standard.
"""
allArchsAndVersions = allScramArchsAndVersions()
if allArchsAndVersions == {}:
# The tag collector is probably down
# NO valid CMSSW Versions is not a valid use case!
# Do nothing.
logging.error("Handed blank list of scramArchs/versions. Ignoring for this cycle.")
return
for scramArch in allArchsAndVersions.keys():
SoftwareAdmin.updateSoftware(scramArch=scramArch, softwareNames=allArchsAndVersions[scramArch])
示例3: handleAddVersion
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import updateSoftware [as 别名]
def handleAddVersion(self, version):
""" Registers a version """
WMCore.Lexicon.cmsswversion(version)
SoftwareAdmin.updateSoftware(version)
return "Added version %s" % version