本文整理汇总了Python中pulp.agent.lib.dispatcher.Dispatcher.update方法的典型用法代码示例。如果您正苦于以下问题:Python Dispatcher.update方法的具体用法?Python Dispatcher.update怎么用?Python Dispatcher.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp.agent.lib.dispatcher.Dispatcher
的用法示例。
在下文中一共展示了Dispatcher.update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_handler
# 需要导入模块: from pulp.agent.lib.dispatcher import Dispatcher [as 别名]
# 或者: from pulp.agent.lib.dispatcher.Dispatcher import update [as 别名]
def test_handler(*unused):
# publish
self.populate(constants.ADDITIVE_STRATEGY)
pulp_conf.set('server', 'storage_dir', self.parentfs)
dist = NodesHttpDistributor()
repo = Repository(self.REPO_ID)
conduit = RepoPublishConduit(self.REPO_ID, constants.HTTP_DISTRIBUTOR)
dist.publish_repo(repo, conduit, self.dist_conf())
units = [{'type_id':'node', 'unit_key':None}]
pulp_conf.set('server', 'storage_dir', self.childfs)
container = Container(self.parentfs)
dispatcher = Dispatcher(container)
container.handlers[CONTENT]['node'] = NodeHandler(self)
container.handlers[CONTENT]['repository'] = RepositoryHandler(self)
report = dispatcher.update(Conduit(), units, {})
_report.append(report)
示例2: update
# 需要导入模块: from pulp.agent.lib.dispatcher import Dispatcher [as 别名]
# 或者: from pulp.agent.lib.dispatcher.Dispatcher import update [as 别名]
def update(self, units, options):
"""
Update the specified content units using the specified options.
Delegated to content handlers.
:param units: A list of content units to be updated.
:type units: list of:
{ type_id:<str>, unit_key:<dict> }
:param options: Update options; based on unit type.
:type options: dict
:return: A dispatch report.
:rtype: DispatchReport
"""
conduit = Conduit()
dispatcher = Dispatcher()
report = dispatcher.update(conduit, units, options)
return report.dict()
示例3: test_handler
# 需要导入模块: from pulp.agent.lib.dispatcher import Dispatcher [as 别名]
# 或者: from pulp.agent.lib.dispatcher.Dispatcher import update [as 别名]
def test_handler(*unused):
# publish
self.populate()
pulp_conf.set('server', 'storage_dir', self.upfs)
dist = CitrusHttpDistributor()
repo = Repository(self.REPO_ID)
conduit = RepoPublishConduit(self.REPO_ID, CITRUS_DISTRUBUTOR)
dist.publish_repo(repo, conduit, self.dist_conf())
options = dict(strategy='additive')
units = [{'type_id':'node', 'unit_key':None}]
pulp_conf.set('server', 'storage_dir', self.downfs)
container = Container(self.upfs)
dispatcher = Dispatcher(container)
container.handlers[CONTENT]['node'] = NodeHandler(self)
container.handlers[CONTENT]['repository'] = RepositoryHandler(self)
report = dispatcher.update(Conduit(), units, options)
_report.append(report)