本文整理汇总了Python中foam.geni.db.GeniDB.insertSliver方法的典型用法代码示例。如果您正苦于以下问题:Python GeniDB.insertSliver方法的具体用法?Python GeniDB.insertSliver怎么用?Python GeniDB.insertSliver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类foam.geni.db.GeniDB
的用法示例。
在下文中一共展示了GeniDB.insertSliver方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _asUTC
# 需要导入模块: from foam.geni.db import GeniDB [as 别名]
# 或者: from foam.geni.db.GeniDB import insertSliver [as 别名]
expiration = _asUTC(datetime.datetime.utcnow()) + ConfigDB.getConfigItemByKey("geni.max-lease").getValue()
for cred in creds:
credexp = _asUTC(cred.expiration)
if credexp < expiration:
expiration = credexp
GeniDB.refreshDevices()
sliver = GENISliver(rspec_dom)
sliver.setUserURN(user_info["urn"])
sliver.setUserEmail(user_info["email"], overwrite=False)
sliver.validate()
GeniDB.insertSliver(slice_urn, sliver, rspec, expiration)
return sliver
class IllegalEthertype(CoreException):
def __init__ (self, dltype):
super(IllegalEthertype, self).__init__()
self.dltype = dltype
def __str__ (self):
return "Experimenters may not request ethertype (%s)" % (self.dltype)
class NoExperimenterEmail(CoreException):
def __init__ (self):
super(NoExperimenterEmail, self).__init__()
def __str__ (self):
return "An email address was not specified in the rspec nor found in the user credential."