本文整理汇总了Python中pulp.plugins.conduits.repo_publish.RepoPublishConduit.get_repo_scratchpad方法的典型用法代码示例。如果您正苦于以下问题:Python RepoPublishConduit.get_repo_scratchpad方法的具体用法?Python RepoPublishConduit.get_repo_scratchpad怎么用?Python RepoPublishConduit.get_repo_scratchpad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp.plugins.conduits.repo_publish.RepoPublishConduit
的用法示例。
在下文中一共展示了RepoPublishConduit.get_repo_scratchpad方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_publisher
# 需要导入模块: from pulp.plugins.conduits.repo_publish import RepoPublishConduit [as 别名]
# 或者: from pulp.plugins.conduits.repo_publish.RepoPublishConduit import get_repo_scratchpad [as 别名]
def _init_publisher(self):
repo = Repository(self.repo_id, working_dir=self.working_dir)
self.repo = repo
conduit = RepoPublishConduit(repo.id, YUM_DISTRIBUTOR_ID)
conduit.last_publish = mock.Mock(return_value=None)
conduit.get_repo_scratchpad = mock.Mock(return_value={})
config_defaults = {'http': True,
'https': True,
'relative_url': None,
'http_publish_dir': os.path.join(self.published_dir, 'http'),
'https_publish_dir': os.path.join(self.published_dir, 'https')}
config = PluginCallConfiguration(None, None)
config.default_config.update(config_defaults)
self.publisher = publish.BaseYumRepoPublisher(repo, conduit, config, YUM_DISTRIBUTOR_ID,
working_dir=self.working_dir)
self.publisher.get_checksum_type = mock.Mock(return_value=None)
# mock out the repomd_file_context, so _publish_<step> can be called
# outside of the publish() method
self.publisher.repomd_file_context = mock.MagicMock()
self.publisher.all_steps = mock.MagicMock()
示例2: setUp
# 需要导入模块: from pulp.plugins.conduits.repo_publish import RepoPublishConduit [as 别名]
# 或者: from pulp.plugins.conduits.repo_publish.RepoPublishConduit import get_repo_scratchpad [as 别名]
def setUp(self):
self.working_directory = tempfile.mkdtemp()
self.content_dir = os.path.join(self.working_directory, 'content')
self.working_dir = os.path.join(self.working_directory, 'work')
os.makedirs(self.working_dir)
self.repo = Repository(id='foo', working_dir=self.working_dir)
config = PluginCallConfiguration(None, None)
conduit = RepoPublishConduit(self.repo.id, 'foo_repo')
conduit.get_repo_scratchpad = Mock(return_value={u'tags': {}})
self.parent = steps.PluginStep('test-step', self.repo, conduit, config)
示例3: setUp
# 需要导入模块: from pulp.plugins.conduits.repo_publish import RepoPublishConduit [as 别名]
# 或者: from pulp.plugins.conduits.repo_publish.RepoPublishConduit import get_repo_scratchpad [as 别名]
def setUp(self):
self.temp_dir = tempfile.mkdtemp()
self.working_directory = os.path.join(self.temp_dir, 'working')
self.publish_directory = os.path.join(self.temp_dir, 'publish')
self.content_directory = os.path.join(self.temp_dir, 'content')
os.makedirs(self.working_directory)
os.makedirs(self.publish_directory)
os.makedirs(self.content_directory)
repo = Repository('foo_repo_id', working_dir=self.working_directory)
config = PluginCallConfiguration(None, None)
conduit = RepoPublishConduit(repo.id, 'foo_repo')
conduit.get_repo_scratchpad = Mock(return_value={u'tags': {}})
self.parent = PublishStep('test-step', repo, conduit, config)
示例4: _init_publisher
# 需要导入模块: from pulp.plugins.conduits.repo_publish import RepoPublishConduit [as 别名]
# 或者: from pulp.plugins.conduits.repo_publish.RepoPublishConduit import get_repo_scratchpad [as 别名]
def _init_publisher(self):
repo = Repository(self.repo_id, working_dir=self.working_dir)
conduit = RepoPublishConduit(repo.id, YUM_DISTRIBUTOR_ID)
conduit.get_repo_scratchpad = mock.Mock(return_value={})
config_defaults = {
"http": True,
"https": True,
"relative_url": None,
"http_publish_dir": os.path.join(self.published_dir, "http"),
"https_publish_dir": os.path.join(self.published_dir, "https"),
}
config = PluginCallConfiguration(None, None)
config.default_config.update(config_defaults)
self.publisher = publish.Publisher(repo, conduit, config)
# mock out the repomd_file_context, so _publish_<step> can be called
# outside of the publish() method
self.publisher.repomd_file_context = mock.MagicMock()