• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python api._create_manager函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pulp.plugins.loader.api._create_manager函数的典型用法代码示例。如果您正苦于以下问题:Python _create_manager函数的具体用法?Python _create_manager怎么用?Python _create_manager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了_create_manager函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: setUp

 def setUp(self):
     super(QueryTests, self).setUp()
     RepoContentUnit.get_collection().remove()
     unit_db.clean()
     self.define_plugins()
     plugin_api._create_manager()
     plugin_api._MANAGER.importers.add_plugin(constants.HTTP_IMPORTER, NodesHttpImporter, {})
开发者ID:BrnoPCmaniak,项目名称:pulp,代码行数:7,代码来源:test_conduit.py


示例2: setUp

 def setUp(self):
     super(BindManagerTests, self).setUp()
     Consumer.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     Bind.get_collection().remove()
     plugin_api._create_manager()
     mock_plugins.install()
开发者ID:ehelms,项目名称:pulp,代码行数:8,代码来源:test_bind_manager.py


示例3: setUp

    def setUp(self):
        super(RepoManagerTests, self).setUp()

        plugin_api._create_manager()
        mock_plugins.install()

        # Create the manager instance to test
        self.manager = repo_manager.RepoManager()
开发者ID:beav,项目名称:pulp,代码行数:8,代码来源:test_cud.py


示例4: setUp

 def setUp(self):
     base.PulpWebserviceTests.setUp(self)
     Consumer.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     Bind.get_collection().remove()
     plugin_api._create_manager()
     mock_plugins.install()
开发者ID:hgschmie,项目名称:pulp,代码行数:8,代码来源:test_consumers.py


示例5: setUp

 def setUp(self):
     super(ScheduledUnitInstallTests, self).setUp()
     plugin_api._create_manager()
     mock_plugins.install()
     mock_agent.install()
     self.consumer_id = 'test-consumer'
     self.consumer_manager = factory.consumer_manager()
     self.consumer_manager.register(self.consumer_id)
开发者ID:pkilambi,项目名称:pulp,代码行数:8,代码来源:test_consumer_controller.py


示例6: setUp

 def setUp(self):
     super(BindManagerTests, self).setUp()
     Consumer.get_collection().remove()
     model.Distributor.objects.delete()
     Bind.get_collection().remove()
     ConsumerHistoryEvent.get_collection().remove()
     plugin_api._create_manager()
     mock_plugins.install()
开发者ID:alanoe,项目名称:pulp,代码行数:8,代码来源:test_bind.py


示例7: setUp

 def setUp(self):
     super(self.__class__, self).setUp()
     Consumer.get_collection().remove()
     ConsumerGroup.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     Bind.get_collection().remove()
     plugin_api._create_manager()
     mock_plugins.install()
开发者ID:cliffy94,项目名称:pulp,代码行数:9,代码来源:test_consumer_group_controller.py


示例8: setUp

    def setUp(self):
        super(PluginControllerTests, self).setUp()

        plugin_api._create_manager()
        types_db.clean()

        # Configure content manager
        plugin_api._MANAGER.importers.add_plugin('MockImporter', MockImporter, {})
        plugin_api._MANAGER.distributors.add_plugin('MockDistributor', MockDistributor, {})
开发者ID:AndreaGiardini,项目名称:pulp,代码行数:9,代码来源:test_plugin_controller.py


示例9: setUp

 def setUp(self):
     super(ContainerTest, self).setUp()
     ContentCatalog.get_collection().remove()
     self.tmp_dir = mkdtemp()
     self.downloaded = os.path.join(self.tmp_dir, 'downloaded')
     os.makedirs(self.downloaded)
     self.add_sources()
     plugins._create_manager()
     plugins._MANAGER.catalogers.add_plugin('yum', FakeCataloger, {})
开发者ID:skarmark,项目名称:pulp,代码行数:9,代码来源:test_content_sources.py


示例10: setUp

 def setUp(self):
     PulpItineraryTests.setUp(self)
     Consumer.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     Bind.get_collection().remove()
     plugin_api._create_manager()
     mock_plugins.install()
     mock_agent.install()
开发者ID:ashcrow,项目名称:pulp,代码行数:9,代码来源:test_bind_itineraries.py


示例11: setUp

 def setUp(self):
     super(QueryTests, self).setUp()
     Repo.get_collection().remove()
     RepoContentUnit.get_collection().remove()
     unit_db.clean()
     for type_id in ALL_TYPES:
         unit_db.type_definition = Mock(return_value=dict(id=type_id, unit_key=UNIT_METADATA))
     unit_db.type_units_unit_key = Mock(return_value=['A', 'B', 'C', 'N'])
     plugin_api._create_manager()
     plugin_api._MANAGER.importers.add_plugin(constants.HTTP_IMPORTER, NodesHttpImporter, {})
开发者ID:cliffy94,项目名称:pulp,代码行数:10,代码来源:test_conduit.py


示例12: setUp

 def setUp(self):
     base.PulpServerTests.setUp(self)
     Consumer.get_collection().remove()
     UnitProfile.get_collection().remove()
     plugins._create_manager()
     mock_plugins.install()
     profiler, cfg = plugins.get_profiler_by_type('rpm')
     profiler.units_applicable = \
         Mock(side_effect=lambda i,r,t,u,c,x:
              [ApplicabilityReport('mysummary', 'mydetails')])
开发者ID:domcleal,项目名称:pulp,代码行数:10,代码来源:test_applicability_manager.py


示例13: setUp

 def setUp(self):
     TestCase.setUp(self)
     api._MANAGER = None
     api._create_manager()
     api._MANAGER.importers.add_plugin(IMPORTER_ID, MockImporter, {})
     api._MANAGER.group_importers.add_plugin(GRP_IMPORTER_ID, MockGroupImporter, {})
     api._MANAGER.distributors.add_plugin(DISTRIBUTOR_ID, MockDistributor, {})
     api._MANAGER.group_distributors.add_plugin(GRP_DISTRIBUTOR_ID, MockGroupDistributor, {})
     api._MANAGER.profilers.add_plugin(PROFILER_ID, MockProfiler, {}, TYPES)
     api._MANAGER.catalogers.add_plugin(CATALOGER_ID, MockCataloger, {})
开发者ID:AndreaGiardini,项目名称:pulp,代码行数:10,代码来源:test_plugin_api.py


示例14: setUp

 def setUp(self):
     super(BaseProfilerConduitTests, self).setUp()
     Consumer.get_collection().remove()
     RepoDistributor.get_collection().remove()
     Bind.get_collection().remove()
     RepoContentUnit.get_collection().remove()
     UnitProfile.get_collection().remove()
     plugin_api._create_manager()
     typedb.update_database([self.TYPE_1_DEF, self.TYPE_2_DEF])
     mock_plugins.install()
开发者ID:jeremycline,项目名称:pulp,代码行数:10,代码来源:test_profiler.py


示例15: setUp

 def setUp(self):
     PulpAsyncServerTests.setUp(self)
     ContentCatalog.get_collection().remove()
     self.tmp_dir = mkdtemp()
     self.downloaded = os.path.join(self.tmp_dir, 'downloaded')
     os.makedirs(self.downloaded)
     self.add_sources()
     MockListener.download_started.reset_mock()
     MockListener.download_succeeded.reset_mock()
     MockListener.download_failed.reset_mock()
     plugins._create_manager()
     plugins._MANAGER.catalogers.add_plugin('yum', MockCataloger, {})
开发者ID:ashcrow,项目名称:pulp,代码行数:12,代码来源:test_content_sources.py


示例16: setUp

    def setUp(self):
        super(PluginManagerTests, self).setUp()

        plugin_api._create_manager()

        # Configure content manager
        plugin_api._MANAGER.importers.add_plugin('MockImporter', MockImporter, {})
        plugin_api._MANAGER.distributors.add_plugin('MockDistributor', MockDistributor, {})
        plugin_api._MANAGER.profilers.add_plugin('MockProfiler', MockProfiler, {})
        plugin_api._MANAGER.catalogers.add_plugin('MockCataloger', MockCataloger, {})

        # Create the manager instance to test
        self.manager = plugin_manager.PluginManager()
开发者ID:alanoe,项目名称:pulp,代码行数:13,代码来源:test_plugin.py


示例17: install

def install():
    """
    Install the plugin loader monkey patch dummy plugins for testing.
    """
    global IMPORTER_MAPPINGS, DISTRIBUTOR_MAPPINGS, GROUP_DISTRIBUTOR_MAPPINGS, \
           _ORIG_GET_IMPORTER_BY_ID, _ORIG_GET_DISTRIBUTOR_BY_ID, _ORIG_GET_GROUP_DISTRIBUTOR_BY_ID

    # update plugin loader inventory

    plugin_api._create_manager()
    plugin_api._MANAGER.importers.add_plugin('dummy-importer', DummyImporter, {})
    plugin_api._MANAGER.distributors.add_plugin('dummy-distributor', DummyDistributor, {})
    plugin_api._MANAGER.distributors.add_plugin('dummy-distributor-2', DummyDistributor, {})
    plugin_api._MANAGER.group_distributors.add_plugin('dummy-group-distributor', DummyGroupDistributor, {})

    # setup the importer/distributor mappings that return the dummy instances

    IMPORTER_MAPPINGS = {'dummy-importer': DUMMY_IMPORTER}
    DISTRIBUTOR_MAPPINGS = {'dummy-distributor': DUMMY_DISTRIBUTOR,
                            'dummy-distributor-2': DUMMY_DISTRIBUTOR_2}
    GROUP_DISTRIBUTOR_MAPPINGS = {'dummy-group-distributor' : DUMMY_GROUP_DISTRIBUTOR}

    # save state of original plugin so it can be reverted

    _ORIG_GET_IMPORTER_BY_ID = plugin_api.get_importer_by_id
    _ORIG_GET_DISTRIBUTOR_BY_ID = plugin_api.get_distributor_by_id
    _ORIG_GET_GROUP_DISTRIBUTOR_BY_ID = plugin_api.get_group_distributor_by_id

    # monkey-patch methods to return the dummy instances

    def dummy_get_importer_by_id(id):
        if id not in IMPORTER_MAPPINGS:
            raise plugin_exceptions.PluginNotFound()
        return IMPORTER_MAPPINGS[id], {}

    def dummy_get_distributor_by_id(id):
        if id not in DISTRIBUTOR_MAPPINGS:
            raise plugin_exceptions.PluginNotFound()
        return DISTRIBUTOR_MAPPINGS[id], {}

    def dummy_get_group_distributor_by_id(id):
        if id not in GROUP_DISTRIBUTOR_MAPPINGS:
            raise plugin_exceptions.PluginNotFound()
        return GROUP_DISTRIBUTOR_MAPPINGS[id], {}

    # monkey-patch in the dummy methods

    plugin_api.get_importer_by_id = dummy_get_importer_by_id
    plugin_api.get_distributor_by_id = dummy_get_distributor_by_id
    plugin_api.get_group_distributor_by_id = dummy_get_group_distributor_by_id
开发者ID:bartwo,项目名称:pulp,代码行数:50,代码来源:dummy_plugins.py


示例18: setUp

 def setUp(self):
     WebTest.setUp(self)
     self.upfs = self.tmpdir('upstream-')
     self.downfs = self.tmpdir('downstream-')
     self.alias = (self.upfs, self.upfs)
     Consumer.get_collection().remove()
     Bind.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     RepoImporter.get_collection().remove()
     RepoContentUnit.get_collection().remove()
     unit_db.clean()
     plugin_api._create_manager()
     plugin_api._MANAGER.importers.add_plugin(CITRUS_IMPORTER, CitrusHttpImporter, {})
     plugin_api._MANAGER.distributors.add_plugin(CITRUS_DISTRUBUTOR, CitrusHttpDistributor, {})
     unit_db.type_definition = \
         Mock(return_value=dict(id=self.TYPEDEF_ID, unit_key=self.UNIT_METADATA))
     unit_db.type_units_unit_key = \
         Mock(return_value=['A', 'B', 'N'])
开发者ID:pieska,项目名称:pulp,代码行数:19,代码来源:test_plugins.py


示例19: setUp

 def setUp(self):
     WebTest.setUp(self)
     self.parentfs = self.tmpdir('parent-')
     self.childfs = self.tmpdir('child-')
     self.alias = (self.parentfs, self.parentfs)
     Consumer.get_collection().remove()
     Bind.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     RepoImporter.get_collection().remove()
     RepoContentUnit.get_collection().remove()
     unit_db.clean()
     self.define_plugins()
     plugin_api._create_manager()
     imp_conf = dict(strategy=constants.MIRROR_STRATEGY)
     plugin_api._MANAGER.importers.add_plugin(constants.HTTP_IMPORTER, NodesHttpImporter, imp_conf)
     plugin_api._MANAGER.distributors.add_plugin(constants.HTTP_DISTRIBUTOR, NodesHttpDistributor, {})
     plugin_api._MANAGER.distributors.add_plugin(FAKE_DISTRIBUTOR, FakeDistributor, FAKE_DISTRIBUTOR_CONFIG)
     plugin_api._MANAGER.profilers.add_plugin(constants.PROFILER_ID, NodeProfiler, {})
开发者ID:ipanova,项目名称:pulp,代码行数:19,代码来源:test_plugins.py


示例20: setUp

 def setUp(self):
     WebTest.setUp(self)
     self.parentfs = self.tmpdir('parent-')
     self.childfs = self.tmpdir('child-')
     self.alias = (self.parentfs, self.parentfs)
     Consumer.get_collection().remove()
     Bind.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     RepoImporter.get_collection().remove()
     RepoContentUnit.get_collection().remove()
     unit_db.clean()
     plugin_api._create_manager()
     plugin_api._MANAGER.importers.add_plugin(HTTP_IMPORTER, NodesHttpImporter, {})
     plugin_api._MANAGER.distributors.add_plugin(HTTP_DISTRIBUTOR, NodesHttpDistributor, {})
     plugin_api._MANAGER.distributors.add_plugin(FAKE_DISTRIBUTOR, FakeDistributor, {})
     unit_db.type_definition = \
         Mock(return_value=dict(id=self.TYPEDEF_ID, unit_key=self.UNIT_METADATA))
     unit_db.type_units_unit_key = \
         Mock(return_value=['A', 'B', 'N'])
开发者ID:domcleal,项目名称:pulp,代码行数:20,代码来源:test_plugins.py



注:本文中的pulp.plugins.loader.api._create_manager函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python api.get_distributor_by_id函数代码示例发布时间:2022-05-25
下一篇:
Python repo_publish.RepoPublishConduit类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap