示例#1
0
 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()
示例#2
0
 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)
示例#3
0
 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()
示例#4
0
 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)