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

Python consumer.Consumer类代码示例

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

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



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

示例1: tearDown

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


示例2: test_update_notes

    def test_update_notes(self):
        """
        Tests updating notes of a consumer
        """

        # Setup
        consumer_id = "consumer_1"
        name = "Consumer 1"
        description = "Test Consumer 1"
        notes = {"note1": "value1", "note2": "value2"}
        self.manager.register(consumer_id, name, description, notes)

        consumers = list(Consumer.get_collection().find())
        self.assertEqual(1, len(consumers))
        consumer = consumers[0]
        self.assertEqual(consumer["notes"], notes)

        # Test
        updated_notes = {"note1": "new-value1", "note2": "new-value2"}
        self.manager.update(consumer_id, delta={"notes": updated_notes})

        # Verify
        consumers = list(Consumer.get_collection().find())
        consumer = consumers[0]
        self.assertEqual(consumer["notes"], updated_notes)
开发者ID:ryanschneider,项目名称:pulp,代码行数:25,代码来源:test_consumer_manager.py


示例3: tearDown

 def tearDown(self):
     PulpItineraryTests.tearDown(self)
     Consumer.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     Bind.get_collection().remove()
     mock_plugins.reset()
开发者ID:ashcrow,项目名称:pulp,代码行数:7,代码来源:test_bind_itineraries.py


示例4: unregister

    def unregister(self, id):
        """
        Unregisters given consumer.

        @param id: identifies the consumer being unregistered
        @type  id: str

        @raises MissingResource: if the given consumer does not exist
        @raises OperationFailed: if any part of the unregister process fails;
                the exception will contain information on which sections failed
        @raises PulpExecutionException: if error during updating database collection
        """

        self.get_consumer(id)
        
        # Remove associate bind
        manager = factory.consumer_bind_manager()
        manager.consumer_deleted(id)
        
        # Remove associated profiles
        manager = factory.consumer_profile_manager()
        manager.consumer_deleted(id)

        # Notify agent
        agent_consumer = factory.consumer_agent_manager()
        agent_consumer.unregistered(id)

        # Database Updates
        try:
            Consumer.get_collection().remove({'id' : id}, safe=True)
        except Exception:
            _LOG.exception('Error updating database collection while removing consumer [%s]' % id)
            raise PulpExecutionException("database-error"), None, sys.exc_info()[2]

        factory.consumer_history_manager().record_event(id, 'consumer_unregistered')
开发者ID:stpierre,项目名称:pulp,代码行数:35,代码来源:cud.py


示例5: test_add_notes

    def test_add_notes(self):
        """
        Tests adding notes to a consumer.
        """

        # Setup
        consumer_id = "consumer_1"
        name = "Consumer 1"
        description = "Test Consumer 1"
        self.manager.register(consumer_id, name, description)

        consumers = list(Consumer.get_collection().find())
        self.assertEqual(1, len(consumers))

        # Test
        consumer = consumers[0]
        self.assertEqual(consumer["notes"], {})

        notes = {"note1": "value1", "note2": "value2"}
        self.manager.update(consumer_id, delta={"notes": notes})

        # Verify
        consumers = list(Consumer.get_collection().find())
        consumer = consumers[0]
        self.assertEqual(consumer["notes"], notes)
开发者ID:ryanschneider,项目名称:pulp,代码行数:25,代码来源:test_consumer_manager.py


示例6: test_add_notes

    def test_add_notes(self):
        """
        Tests adding notes to a consumer.
        """

        # Setup
        consumer_id = 'consumer_1'
        name = 'Consumer 1'
        description = 'Test Consumer 1'
        self.manager.register(consumer_id, name, description)

        consumers = list(Consumer.get_collection().find())
        self.assertEqual(1, len(consumers))

        # Test
        consumer = consumers[0]
        self.assertEqual(consumer['notes'], {})

        notes = {'note1' : 'value1', 'note2' : 'value2'}
        self.manager.update(consumer_id, delta={'notes':notes})

        # Verify
        consumers = list(Consumer.get_collection().find())
        consumer = consumers[0]
        self.assertEqual(consumer['notes'], notes)
开发者ID:signull,项目名称:pulp,代码行数:25,代码来源:test_consumer_manager.py


示例7: test_update_notes

    def test_update_notes(self):
        """
        Tests updating notes of a consumer
        """

        # Setup
        consumer_id = 'consumer_1'
        name = 'Consumer 1'
        description = 'Test Consumer 1'
        notes = {'note1' : 'value1', 'note2' : 'value2'}
        self.manager.register(consumer_id, name, description, notes)

        consumers = list(Consumer.get_collection().find())
        self.assertEqual(1, len(consumers))
        consumer = consumers[0]
        self.assertEqual(consumer['notes'], notes)

        # Test
        updated_notes = {'note1' : 'new-value1', 'note2' : 'new-value2'}
        self.manager.update(consumer_id, delta={'notes':updated_notes})

        # Verify
        consumers = list(Consumer.get_collection().find())
        consumer = consumers[0]
        self.assertEqual(consumer['notes'], updated_notes)
开发者ID:signull,项目名称:pulp,代码行数:25,代码来源:test_consumer_manager.py


示例8: tearDown

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


示例9: 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


示例10: tearDown

 def tearDown(self):
     PulpRPMTests.tearDown(self)
     Consumer.get_collection().remove()
     Repo.get_collection().remove()
     RepoContentUnit.get_collection().remove()
     RepoDistributor.get_collection().remove()
     database.clean()
     plugins.finalize()
开发者ID:bechtoldt,项目名称:pulp_rpm,代码行数:8,代码来源:test_errata.py


示例11: tearDown

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


示例12: 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


示例13: tearDown

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


示例14: 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


示例15: 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


示例16: 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


示例17: setUp

 def setUp(self):
     base.PulpWebserviceTests.setUp(self)
     Consumer.get_collection().remove()
     UnitProfile.get_collection().remove()
     plugin_api._create_manager()
     mock_plugins.install()
     profiler = plugin_api.get_profiler_by_type('errata')[0]
     profiler.unit_applicable = \
         mock.Mock(side_effect=lambda i,u,c,x:
             ApplicabilityReport(u, True, self.SUMMARY, self.DETAILS))
开发者ID:pkilambi,项目名称:pulp,代码行数:10,代码来源:test_consumer_controller.py


示例18: 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


示例19: 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


示例20: tearDown

 def tearDown(self):
     super(BaseProfilerConduitTests, self).tearDown()
     Consumer.get_collection().remove()
     Repo.get_collection().remove()
     RepoDistributor.get_collection().remove()
     Bind.get_collection().remove()
     RepoContentUnit.get_collection().remove()
     UnitProfile.get_collection().remove()
     typedb.clean()
     factory.reset()
开发者ID:fdammeke,项目名称:pulp,代码行数:10,代码来源:test_profiler_conduit.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python consumer.ConsumerGroup类代码示例发布时间:2022-05-25
下一篇:
Python auth.User类代码示例发布时间: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