本文整理汇总了Python中mmc.plugins.msc.mirror_api.MirrorApi.addErrback方法的典型用法代码示例。如果您正苦于以下问题:Python MirrorApi.addErrback方法的具体用法?Python MirrorApi.addErrback怎么用?Python MirrorApi.addErrback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mmc.plugins.msc.mirror_api.MirrorApi
的用法示例。
在下文中一共展示了MirrorApi.addErrback方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: uuidFilter2
# 需要导入模块: from mmc.plugins.msc.mirror_api import MirrorApi [as 别名]
# 或者: from mmc.plugins.msc.mirror_api.MirrorApi import addErrback [as 别名]
def uuidFilter2(self, package_apis):
self.package_apis = package_apis
# warn as we do pop in package retrival but we want to keep the packages
# in the good order, we need to reverse the package api list order
self.package_apis.reverse()
d = MirrorApi().getMirror(self.machine)
d.addCallbacks(self.uuidFilter3, self.onError)
d.addErrback(lambda err: self.onError(err))
示例2: get
# 需要导入模块: from mmc.plugins.msc.mirror_api import MirrorApi [as 别名]
# 或者: from mmc.plugins.msc.mirror_api.MirrorApi import addErrback [as 别名]
def get(self):
try:
self.machine = self.filt["uuid"]
d = MirrorApi().getApiPackage(self.machine)
d.addCallbacks(self.uuidFilter2, self.onError)
d.addErrback(lambda err: self.onError(err))
except KeyError:
self.sendResult()
示例3: cbGetTargetsFallbackMirrors
# 需要导入模块: from mmc.plugins.msc.mirror_api import MirrorApi [as 别名]
# 或者: from mmc.plugins.msc.mirror_api.MirrorApi import addErrback [as 别名]
def cbGetTargetsFallbackMirrors(mirrors, schedulers):
args = map(lambda x: {"uuid" : x[0], "name": x[1]}, targets)
d2 = MirrorApi().getFallbackMirrors(args)
d2.addCallback(cbCreateTargets, mirrors, schedulers)
d2.addErrback(lambda err: err)
return d2
示例4: cbGetTargetsMirrors
# 需要导入模块: from mmc.plugins.msc.mirror_api import MirrorApi [as 别名]
# 或者: from mmc.plugins.msc.mirror_api.MirrorApi import addErrback [as 别名]
def cbGetTargetsMirrors(schedulers):
args = map(lambda x: {"uuid" : x[0], "name": x[1]}, targets)
d1 = MirrorApi().getMirrors(args)
d1.addCallback(cbGetTargetsFallbackMirrors, schedulers)
d1.addErrback(lambda err: err)
return d1
示例5: getMirrors
# 需要导入模块: from mmc.plugins.msc.mirror_api import MirrorApi [as 别名]
# 或者: from mmc.plugins.msc.mirror_api.MirrorApi import addErrback [as 别名]
def getMirrors(self, package_apis):
self.package_apis = package_apis
d = MirrorApi().getMirrors(self.machines)
d.addCallbacks(self.getMirrorsResult, self.onError)
d.addErrback(lambda err: self.onError(err))