本文整理汇总了Python中WMCore.RequestManager.RequestDB.Interface.Request.ChangeState.changeRequestPriority方法的典型用法代码示例。如果您正苦于以下问题:Python ChangeState.changeRequestPriority方法的具体用法?Python ChangeState.changeRequestPriority怎么用?Python ChangeState.changeRequestPriority使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WMCore.RequestManager.RequestDB.Interface.Request.ChangeState
的用法示例。
在下文中一共展示了ChangeState.changeRequestPriority方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: changePriority
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Request import ChangeState [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Request.ChangeState import changeRequestPriority [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
示例2: changePriority
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Request import ChangeState [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Request.ChangeState import changeRequestPriority [as 别名]
def changePriority(requestName, priority):
""" Changes the priority that's stored in the workload """
# fill in all details
request = GetRequest.getRequestByName(requestName)
ChangeState.changeRequestPriority(requestName, priority)
helper = loadWorkload(request)
helper.data.request.priority = int(priority)
saveWorkload(helper, request['RequestWorkflow'])
示例3: changePriority
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Request import ChangeState [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Request.ChangeState import changeRequestPriority [as 别名]
def changePriority(requestName, priority, wmstatUrl = None):
""" Changes the priority that's stored in the workload """
# fill in all details
request = GetRequest.getRequestByName(requestName)
groupPriority = request.get('ReqMgrGroupBasePriority', 0)
userPriority = request.get('ReqMgrRequestorBasePriority', 0)
ChangeState.changeRequestPriority(requestName, priority)
helper = loadWorkload(request)
totalPriority = int(priority) + int(userPriority) + int(groupPriority)
helper.data.request.priority = totalPriority
saveWorkload(helper, request['RequestWorkflow'], wmstatUrl)
示例4: changePriority
# 需要导入模块: from WMCore.RequestManager.RequestDB.Interface.Request import ChangeState [as 别名]
# 或者: from WMCore.RequestManager.RequestDB.Interface.Request.ChangeState import changeRequestPriority [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, useBody = True)
# push the change to the WorkQueue
gqURL = "%s/workqueue" % request["CouchURL"]
workqueue = WorkQueue.WorkQueue(gqURL)
workqueue.updatePriority(requestName, priority)
return