本文整理汇总了Python中Cobalt.Proxy.ComponentProxy.preempt_jobs方法的典型用法代码示例。如果您正苦于以下问题:Python ComponentProxy.preempt_jobs方法的具体用法?Python ComponentProxy.preempt_jobs怎么用?Python ComponentProxy.preempt_jobs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cobalt.Proxy.ComponentProxy
的用法示例。
在下文中一共展示了ComponentProxy.preempt_jobs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: eval
# 需要导入模块: from Cobalt.Proxy import ComponentProxy [as 别名]
# 或者: from Cobalt.Proxy.ComponentProxy import preempt_jobs [as 别名]
elif opts['stopq']:
response = cqm.set_queues(spec, {'state':'stopped'}, whoami)
elif opts['startq']:
response = cqm.set_queues(spec, {'state':'running'}, whoami)
elif opts['drainq']:
response = cqm.set_queues(spec, {'state':'draining'}, whoami)
elif opts['killq']:
response = cqm.set_queues(spec, {'state':'dead'}, whoami)
elif opts['policy']:
response = cqm.set_queues(spec, {'policy':opts['policy']}, whoami)
elif opts['preempt']:
if not spec:
print "you must specify a jobid to preempt"
raise SystemExit, 1
try:
response = cqm.preempt_jobs(spec, whoami, opts['force'])
except xmlrpclib.Fault, flt:
if flt.faultCode == JobPreemptionError.fault_code:
args = eval(flt.faultString)
exc = JobPreemptionError(*args)
print "Job %s: ERROR - %s" % (exc.jobid, exc.message)
raise SystemExit, 1
else:
raise
else:
updates = {}
if opts['hold']:
updates['admin_hold'] = True
if not spec:
print "you must specify a jobid to hold"
raise SystemExit, 1