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


Python ProdManagement.getProdMgr方法代码示例

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


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

示例1: changePriority

# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import ProdManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.ProdManagement import getProdMgr [as 别名]
def changePriority(requestName, priority, wmstatUrl = None):
    """
    Changes the priority that's stored in the workload.
    Takes the current priority stored in the workload and adds
    to it the input priority value. 
    
    """
    request = requestDetails(requestName)
    # change in Oracle
    newPrior = int(priority)
    ChangeState.changeRequestPriority(requestName, newPrior)
    # change in workload (spec)
    helper = loadWorkload(request)
    helper.data.request.priority = newPrior
    saveWorkload(helper, request['RequestWorkflow'], wmstatUrl)
    # change priority in CouchDB
    couchDb = Database(request["CouchWorkloadDBName"], request["CouchURL"])
    fields = {"RequestPriority": newPrior}
    couchDb.updateDocument(requestName, "ReqMgr", "updaterequest", fields=fields)
    # push the change to the WorkQueue
    response = ProdManagement.getProdMgr(requestName)
    if response == [] or response[0] is None or response[0] == "":
        # Request must not be assigned yet, we are safe here
        return
    workqueue = WorkQueue.WorkQueue(response[0])
    workqueue.updatePriority(requestName, priority)
    return
开发者ID:franzoni,项目名称:WMCore,代码行数:29,代码来源:ReqMgrWebTools.py

示例2: getWorkQueue

# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import ProdManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.ProdManagement import getProdMgr [as 别名]
 def getWorkQueue(self, request=None, workQueue=None):
     """ If a request is passed in, return the URl of the workqueue.
     If a workqueue is passed in, return all requests acquired by it """
     if workQueue != None:
         return ProdMgrRetrieve.findAssignedRequests(workQueue)
     if request != None:
         return ProdManagement.getProdMgr(request)
     # return all the workqueue ulr
     return GetRequest.getGlobalQueues()
开发者ID:AndrewLevin,项目名称:WMCore,代码行数:11,代码来源:ReqMgrRESTModel.py

示例3: abortRequest

# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import ProdManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.ProdManagement import getProdMgr [as 别名]
def abortRequest(request):
    """ Changes the state of the request to "aborted", and asks the work queue
    to cancel its work """
    response = ProdManagement.getProdMgr(request)
    url = response[0]
    if url == None or url == "":
        raise cherrypy.HTTPError(400, "Cannot find URL for request " + request)
    workqueue = WorkQueue.WorkQueue(url)
    workqueue.cancelWorkflow(request)
开发者ID:zhiwenuil,项目名称:WMCore,代码行数:11,代码来源:ReqMgrWebTools.py

示例4: abortRequest

# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Admin import ProdManagement [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Admin.ProdManagement import getProdMgr [as 别名]
def abortRequest(requestName):
    """ Changes the state of the request to "aborted", and asks the work queue
    to cancel its work """
    response = ProdManagement.getProdMgr(requestName)
    if response == [] or response[0] == None or response[0] == "":
        msg =  "Cannot find ProdMgr for request %s\n " % requestName
        msg += "Request may not be known to WorkQueue.  If aborted immediately after assignment, ignore this."
        raise cherrypy.HTTPError(400, msg)
    workqueue = WorkQueue.WorkQueue(response[0])
    workqueue.cancelWorkflow(requestName)
    return
开发者ID:stuartw,项目名称:WMCore,代码行数:13,代码来源:ReqMgrWebTools.py


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