本文整理汇总了Python中WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement.listSoftware方法的典型用法代码示例。如果您正苦于以下问题:Python SoftwareManagement.listSoftware方法的具体用法?Python SoftwareManagement.listSoftware怎么用?Python SoftwareManagement.listSoftware使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement
的用法示例。
在下文中一共展示了SoftwareManagement.listSoftware方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testA_SoftwareManagement
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import listSoftware [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: checkIn
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import listSoftware [as 别名]
def checkIn(request):
"""
_CheckIn_
Check in of a request manager
Given a new request, check it in to the DB and add the
appropriate IDs.
"""
# //
# // First try and register the request in the DB
#//
requestName = request['RequestName']
# test if the software versions are registered first
versions = SoftwareManagement.listSoftware()
for version in request.get('SoftwareVersions', []):
if not version in versions:
raise RuntimeError, "Cannot find software version %s in ReqMgr" % version
try:
reqId = MakeRequest.createRequest(
request['Requestor'],
request['Group'],
requestName,
request['RequestType'],
request['RequestWorkflow'],
request.get('PrepID', None)
)
except Exception, ex:
msg = "Error creating new request:\n"
msg += str(ex)
raise RuntimeError, msg
示例3: versions
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import listSoftware [as 别名]
def versions(self):
""" Lists all versions """
versions = SoftwareAdmin.listSoftware().keys()
versions.sort()
for version in versions:
WMCore.Lexicon.cmsswversion(version)
return self.templatepage("Versions", versions=versions)
示例4: scramArchs
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import listSoftware [as 别名]
def scramArchs(self):
"""
_scramArchs_
List all scramArchs in the DB
Prelim for putting this in the template pages
"""
return SoftwareAdmin.listSoftware().keys()
示例5: getVersion
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import listSoftware [as 别名]
def getVersion(self):
""" Returns a list of all CMSSW versions registered with ReqMgr """
archList = SoftwareAdmin.listSoftware()
result = []
for arch in archList.keys():
for version in archList[arch]:
if not version in result:
result.append(version)
return result
示例6: versions
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import listSoftware [as 别名]
def versions(self):
""" Lists all versions """
archList = SoftwareAdmin.listSoftware()
versions = []
for versionList in archList.values():
for version in versionList:
if not version in versions:
versions.append(version)
versions.sort()
for version in versions:
WMCore.Lexicon.cmsswversion(version)
return self.templatepage("Versions", versions=versions)
示例7: handleAllVersions
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import listSoftware [as 别名]
def handleAllVersions(self):
""" Registers all versions in the TC """
currentVersions = SoftwareAdmin.listSoftware().keys()
allVersions = Utilities.allSoftwareVersions()
result = ""
for version in allVersions:
if not version in currentVersions:
WMCore.Lexicon.cmsswversion(version)
SoftwareAdmin.addSoftware(version)
result += "Added version %s<br/>" % version
if result == "":
result = "Version list is up to date"
return result
示例8: checkIn
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import listSoftware [as 别名]
def checkIn(request, requestType = 'None'):
"""
_CheckIn_
Check in of a request manager
Given a new request, check it in to the DB and add the
appropriate IDs.
"""
# //
# // First try and register the request in the DB
#//
requestName = request['RequestName']
# test if the software versions are registered first
versions = SoftwareManagement.listSoftware()
scramArch = request.get('ScramArch')
if requestType.lower() in ['resubmission']:
# Do nothing, as we have no valid software version yet
pass
else:
if not scramArch in versions.keys():
m = ("Cannot find scramArch %s in ReqMgr (the one(s) available: %s)" %
(scramArch, versions))
raise RequestCheckInError(m)
for version in request.get('SoftwareVersions', []):
if not version in versions[scramArch]:
raise RequestCheckInError("Cannot find software version %s in ReqMgr for "
"scramArch %s. Supported versions: %s" %
(version, scramArch, versions[scramArch]))
try:
reqId = MakeRequest.createRequest(
request['Requestor'],
request['Group'],
requestName,
request['RequestType'],
request['RequestWorkflow'],
request.get('PrepID', None),
request.get('ReqMgrRequestBasePriority', None)
)
except Exception, ex:
msg = "Error creating new request:\n"
msg += str(ex)
raise RequestCheckInError( msg )
示例9: checkIn
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import listSoftware [as 别名]
def checkIn(request, requestType="None", wmstatSvc=None):
"""
_CheckIn_
Check in of a request manager
Given a new request, check it in to the DB and add the
appropriate IDs.
"""
# //
# // First try and register the request in the DB
# //
requestName = request["RequestName"]
# test if the software versions are registered first
versions = SoftwareManagement.listSoftware()
scramArch = request.get("ScramArch")
if requestType.lower() in ["resubmission"]:
# Do nothing, as we have no valid software version yet
pass
else:
if not scramArch in versions.keys():
m = "Cannot find scramArch %s in ReqMgr (the one(s) available: %s)" % (scramArch, versions)
raise RequestCheckInError(m)
for version in request.get("SoftwareVersions", []):
if not version in versions[scramArch]:
raise RequestCheckInError(
"Cannot find software version %s in ReqMgr for scramArch %s" % (version, scramArch)
)
try:
reqId = MakeRequest.createRequest(
request["Requestor"],
request["Group"],
requestName,
request["RequestType"],
request["RequestWorkflow"],
request.get("PrepID", None),
)
except Exception, ex:
msg = "Error creating new request:\n"
msg += str(ex)
raise RequestCheckInError(msg)
示例10: getVersion
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import listSoftware [as 别名]
def getVersion(self):
""" Returns a list of all CMSSW versions registered with ReqMgr """
return SoftwareAdmin.listSoftware().keys()
示例11: checkIn
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import SoftwareManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.SoftwareManagement import listSoftware [as 别名]
def checkIn(request, requestType="None"):
"""
_CheckIn_
Check in of a request manager
Given a new request, check it in to the DB and add the
appropriate IDs.
"""
# //
# // First try and register the request in the DB
# //
requestName = request["RequestName"]
# test if the software versions are registered first
versions = SoftwareManagement.listSoftware()
scramArch = request.get("ScramArch")
if requestType.lower() in ["resubmission"]:
# Do nothing, as we have no valid software version yet
pass
else:
if not scramArch in versions.keys():
m = "Cannot find scramArch %s in ReqMgr (the one(s) available: %s)" % (scramArch, versions)
raise RequestCheckInError(m)
for version in request.get("SoftwareVersions", []):
if not version in versions[scramArch]:
raise RequestCheckInError(
"Cannot find software version %s in ReqMgr for "
"scramArch %s. Supported versions: %s" % (version, scramArch, versions[scramArch])
)
try:
reqId = MakeRequest.createRequest(
request["Requestor"],
request["Group"],
requestName,
request["RequestType"],
request["RequestWorkflow"],
request.get("PrepID", None),
request.get("RequestPriority", None),
)
except Exception as ex:
msg = "Error creating new request:\n"
msg += str(ex)
raise RequestCheckInError(msg)
# FIXME LAST_INSERT_ID doesn't work on oracle
reqId = GetRequest.requestID(requestName)
request["RequestID"] = reqId
logging.info("Request %s created with request id %s" % (requestName, request["RequestID"]))
# //
# // add metadata about the request
# //
try:
if request["InputDatasetTypes"] != {}:
for ds, dsType in request["InputDatasetTypes"].items():
MakeRequest.associateInputDataset(requestName, ds, dsType)
elif isinstance(request["InputDatasets"], list):
for ds in request["InputDatasets"]:
MakeRequest.associateInputDataset(requestName, ds)
else:
MakeRequest.associateInputDataset(requestName, request["InputDatasets"])
except Exception as ex:
_raiseCheckInError(request, ex, "Unable to Associate input datasets to request")
try:
for ds in request["OutputDatasets"]:
# request['OutputDatasets'] may contain a list of lists (each sublist for a task)
# which is actually not understood why but seems to be correct (Steve)
# dirty
if isinstance(ds, list):
for dss in ds:
MakeRequest.associateOutputDataset(requestName, dss)
else:
MakeRequest.associateOutputDataset(requestName, ds)
except Exception as ex:
_raiseCheckInError(request, ex, "Unable to Associate output datasets to request")
try:
for sw in request["SoftwareVersions"]:
MakeRequest.associateSoftware(requestName, sw)
except Exception as ex:
_raiseCheckInError(request, ex, "Unable to associate software for this request")
MakeRequest.updateRequestSize(
requestName,
request.get("RequestNumEvents", 0),
request.get("RequestSizeFiles", 0),
request.get("SizePerEvent", 0),
)
campaign = request.get("Campaign", "")
if campaign != "" and campaign != None:
Campaign.associateCampaign(campaign, reqId)
logging.info("Request '%s' built with request id '%s" "" % (requestName, request["RequestID"]))