本文整理汇总了Python中kiwi.system.uri.Uri.is_remote方法的典型用法代码示例。如果您正苦于以下问题:Python Uri.is_remote方法的具体用法?Python Uri.is_remote怎么用?Python Uri.is_remote使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.system.uri.Uri
的用法示例。
在下文中一共展示了Uri.is_remote方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_is_remote
# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import is_remote [as 别名]
def test_is_remote(self):
uri = Uri('https://example.com', 'rpm-md')
assert uri.is_remote() is True
uri = Uri('dir:///path/to/repo', 'rpm-md')
assert uri.is_remote() is False
示例2: test_is_remote_raises_type_error
# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import is_remote [as 别名]
def test_is_remote_raises_type_error(self):
uri = Uri('xtp://download.example.com', 'rpm-md')
uri.is_remote()
示例3: setup_repositories
# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import is_remote [as 别名]
def setup_repositories(self, clear_cache=False, signing_keys=None):
"""
Set up repositories for software installation and return a
package manager for performing software installation tasks
:param bool clear_cache: flag the clear cache before configure
anything
:param list signing_keys: keys imported to the package manager
:return: instance of :class:`PackageManager`
:rtype: PackageManager
"""
repository_options = []
repository_sections = \
self.xml_state.get_repository_sections_used_for_build()
package_manager = self.xml_state.get_package_manager()
if self.xml_state.get_rpm_check_signatures():
repository_options.append('check_signatures')
if self.xml_state.get_rpm_excludedocs():
repository_options.append('exclude_docs')
repo = Repository(
self.root_bind, package_manager, repository_options
)
if signing_keys:
repo.import_trusted_keys(signing_keys)
for xml_repo in repository_sections:
repo_type = xml_repo.get_type()
repo_source = xml_repo.get_source().get_path()
repo_user = xml_repo.get_username()
repo_secret = xml_repo.get_password()
repo_alias = xml_repo.get_alias()
repo_priority = xml_repo.get_priority()
repo_dist = xml_repo.get_distribution()
repo_components = xml_repo.get_components()
repo_repository_gpgcheck = xml_repo.get_repository_gpgcheck()
repo_package_gpgcheck = xml_repo.get_package_gpgcheck()
log.info('Setting up repository %s', repo_source)
log.info('--> Type: %s', repo_type)
if repo_priority:
log.info('--> Priority: %s', repo_priority)
uri = Uri(repo_source, repo_type)
repo_source_translated = uri.translate()
log.info('--> Translated: %s', repo_source_translated)
if not repo_alias:
repo_alias = uri.alias()
log.info('--> Alias: %s', repo_alias)
if not uri.is_remote() and not os.path.exists(
repo_source_translated
):
log.warning(
'repository %s does not exist and will be skipped',
repo_source
)
continue
if not uri.is_remote():
self.root_bind.mount_shared_directory(repo_source_translated)
repo.add_repo(
repo_alias, repo_source_translated,
repo_type, repo_priority, repo_dist, repo_components,
repo_user, repo_secret, uri.credentials_file_name(),
repo_repository_gpgcheck, repo_package_gpgcheck
)
if clear_cache:
repo.delete_repo_cache(repo_alias)
self.uri_list.append(uri)
repo.cleanup_unused_repos()
return PackageManager(
repo, package_manager
)
示例4: test_is_remote_raises_style_error
# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import is_remote [as 别名]
def test_is_remote_raises_style_error(self):
uri = Uri('xxx', 'rpm-md')
uri.is_remote()
示例5: test_is_remote_in_buildservice
# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import is_remote [as 别名]
def test_is_remote_in_buildservice(
self, mock_buildservice
):
mock_buildservice.return_value = True
uri = Uri('obs://openSUSE:Leap:42.2/standard', 'yast2')
assert uri.is_remote() is False