本文整理汇总了Python中pulp.server.db.model.repository.RepoDistributor.get_collection方法的典型用法代码示例。如果您正苦于以下问题:Python RepoDistributor.get_collection方法的具体用法?Python RepoDistributor.get_collection怎么用?Python RepoDistributor.get_collection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp.server.db.model.repository.RepoDistributor
的用法示例。
在下文中一共展示了RepoDistributor.get_collection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tearDown
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
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()
示例2: clean
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
def clean(self):
super(RepoManagerTests, self).clean()
model.Repository.drop_collection()
RepoImporter.get_collection().remove()
RepoDistributor.get_collection().remove()
TaskStatus.objects().delete()
示例3: tearDown
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
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()
示例4: tearDown
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
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()
示例5: clean
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
def clean(self):
super(RepoManagerTests, self).clean()
Repo.get_collection().remove()
RepoImporter.get_collection().remove()
RepoDistributor.get_collection().remove()
dispatch.TaskStatus.objects().delete()
示例6: clean
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
def clean(self):
super(RepoDistributorManagerTests, self).clean()
mock_plugins.MOCK_DISTRIBUTOR.reset_mock()
Repo.get_collection().remove()
RepoDistributor.get_collection().remove()
示例7: test_delete_with_plugins
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
def test_delete_with_plugins(self):
"""
Tests that deleting a repo that has importers and distributors configured deletes them as
well.
"""
# Setup
self.manager.create_repo('doomed')
importer_manager = manager_factory.repo_importer_manager()
distributor_manager = manager_factory.repo_distributor_manager()
importer_manager.set_importer('doomed', 'mock-importer', {})
distributor_manager.add_distributor('doomed', 'mock-distributor', {}, True,
distributor_id='dist-1')
distributor_manager.add_distributor('doomed', 'mock-distributor', {}, True,
distributor_id='dist-2')
self.assertEqual(1, len(list(RepoImporter.get_collection().find({'repo_id': 'doomed'}))))
self.assertEqual(2, len(list(RepoDistributor.get_collection().find({'repo_id': 'doomed'}))))
# Test
self.manager.delete_repo('doomed')
# Verify
self.assertEqual(0, len(list(Repo.get_collection().find())))
self.assertEqual(0, len(list(RepoImporter.get_collection().find({'repo_id': 'doomed'}))))
self.assertEqual(0, len(list(RepoDistributor.get_collection().find({'repo_id': 'doomed'}))))
self.assertEqual(1, mock_plugins.MOCK_IMPORTER.importer_removed.call_count)
self.assertEqual(2, mock_plugins.MOCK_DISTRIBUTOR.distributor_removed.call_count)
repo_working_dir = common_utils.repository_working_dir('doomed', mkdir=False)
self.assertTrue(not os.path.exists(repo_working_dir))
示例8: test_import
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
def test_import(self):
# Setup
self.populate()
pulp_conf.set('server', 'storage_dir', self.parentfs)
dist = NodesHttpDistributor()
repo = Repository(self.REPO_ID)
cfg = {
'protocol':'file',
'http':{'alias':self.alias},
'https':{'alias':self.alias},
'file':{'alias':self.alias},
}
conduit = RepoPublishConduit(self.REPO_ID, constants.HTTP_DISTRIBUTOR)
dist.publish_repo(repo, conduit, cfg)
Repo.get_collection().remove()
RepoDistributor.get_collection().remove()
RepoContentUnit.get_collection().remove()
unit_db.clean()
# Test
importer = NodesHttpImporter()
publisher = dist.publisher(repo, cfg)
manifest_url = 'file://' + publisher.manifest_path()
cfg = dict(manifest_url=manifest_url, strategy=constants.MIRROR_STRATEGY)
conduit = RepoSyncConduit(
self.REPO_ID,
constants.HTTP_IMPORTER,
RepoContentUnit.OWNER_TYPE_IMPORTER,
constants.HTTP_IMPORTER)
importer.sync_repo(repo, conduit, cfg)
# Verify
units = conduit.get_units()
self.assertEquals(len(units), self.NUM_UNITS)
示例9: clean
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
def clean(self):
Bind.get_collection().remove()
Repo.get_collection().remove()
RepoDistributor.get_collection().remove()
RepoImporter.get_collection().remove()
RepoContentUnit.get_collection().remove()
unit_db.clean()
示例10: clean
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
def clean(self):
super(RepoPublishConduitTests, self).clean()
mock_plugins.reset()
Repo.get_collection().remove()
RepoDistributor.get_collection().remove()
示例11: setUp
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
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()
示例12: tearDown
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
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()
示例13: tearDown
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
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()
示例14: setUp
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
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()
示例15: tearDown
# 需要导入模块: from pulp.server.db.model.repository import RepoDistributor [as 别名]
# 或者: from pulp.server.db.model.repository.RepoDistributor import get_collection [as 别名]
def tearDown(self):
super(BindManagerTests, self).tearDown()
Consumer.get_collection().remove()
model.Repository.drop_collection()
RepoDistributor.get_collection().remove()
Bind.get_collection().remove()
ConsumerHistoryEvent.get_collection().remove()
mock_plugins.reset()