本文整理匯總了Python中mmc.plugins.msc.mirror_api.MirrorApi.addCallbacks方法的典型用法代碼示例。如果您正苦於以下問題:Python MirrorApi.addCallbacks方法的具體用法?Python MirrorApi.addCallbacks怎麽用?Python MirrorApi.addCallbacks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mmc.plugins.msc.mirror_api.MirrorApi
的用法示例。
在下文中一共展示了MirrorApi.addCallbacks方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: uuidFilter2
# 需要導入模塊: from mmc.plugins.msc.mirror_api import MirrorApi [as 別名]
# 或者: from mmc.plugins.msc.mirror_api.MirrorApi import addCallbacks [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 addCallbacks [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: getMirrors
# 需要導入模塊: from mmc.plugins.msc.mirror_api import MirrorApi [as 別名]
# 或者: from mmc.plugins.msc.mirror_api.MirrorApi import addCallbacks [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))