本文整理汇总了Python中Cobalt.Proxy.ComponentProxy.release_reservations方法的典型用法代码示例。如果您正苦于以下问题:Python ComponentProxy.release_reservations方法的具体用法?Python ComponentProxy.release_reservations怎么用?Python ComponentProxy.release_reservations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cobalt.Proxy.ComponentProxy
的用法示例。
在下文中一共展示了ComponentProxy.release_reservations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ComponentProxy
# 需要导入模块: from Cobalt.Proxy import ComponentProxy [as 别名]
# 或者: from Cobalt.Proxy.ComponentProxy import release_reservations [as 别名]
scheduler = ComponentProxy("scheduler", defer=False)
except ComponentLookupError:
print "Failed to connect to scheduler"
raise SystemExit, 1
# Check if reservation exists
spec = [{'name': arg} for arg in args]
try:
result = scheduler.get_reservations(spec)
except xmlrpclib.Fault, flt:
if flt.faultCode == 1:
print "Error communicating with scheduler"
sys.exit(1)
if len(result) and len(result) != len(args):
print "Reservation subset matched"
elif not result:
print "No Reservations matched"
raise SystemExit, 1
try:
result = scheduler.release_reservations(spec, pwd.getpwuid(os.getuid())[0])
except xmlrpclib.Fault, flt:
if flt.faultCode == 1:
print "Error communicating with scheduler"
sys.exit(1)
print "Released reservation '%s', matched on %d partitions" % \
(','.join(args), len(result))