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


Python SoftwareManagement.listSoftware方法代码示例

本文整理汇总了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
开发者ID:stuartw,项目名称:WMCore,代码行数:33,代码来源:Admin_t.py

示例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
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:35,代码来源:CheckIn.py

示例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)
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:9,代码来源:Admin.py

示例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()
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:10,代码来源:Admin.py

示例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
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:11,代码来源:ReqMgrRESTModel.py

示例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)
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:14,代码来源:Admin.py

示例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
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:15,代码来源:Admin.py

示例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 )
开发者ID:ticoann,项目名称:WMCore,代码行数:47,代码来源:CheckIn.py

示例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)
开发者ID:stuartw,项目名称:WMCore,代码行数:45,代码来源:CheckIn.py

示例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()
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:5,代码来源:ReqMgrRESTModel.py

示例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"]))
开发者ID:dciangot,项目名称:WMCore,代码行数:97,代码来源:CheckIn.py


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