當前位置: 首頁>>代碼示例>>Python>>正文


Python Uri.credentials_file_name方法代碼示例

本文整理匯總了Python中kiwi.system.uri.Uri.credentials_file_name方法的典型用法代碼示例。如果您正苦於以下問題:Python Uri.credentials_file_name方法的具體用法?Python Uri.credentials_file_name怎麽用?Python Uri.credentials_file_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kiwi.system.uri.Uri的用法示例。


在下文中一共展示了Uri.credentials_file_name方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: import_repositories_marked_as_imageinclude

# 需要導入模塊: from kiwi.system.uri import Uri [as 別名]
# 或者: from kiwi.system.uri.Uri import credentials_file_name [as 別名]
 def import_repositories_marked_as_imageinclude(self):
     """
     Those <repository> sections which are marked with the
     imageinclude attribute should be permanently added to
     the image repository configuration
     """
     repository_sections = \
         self.xml_state.get_repository_sections_used_in_image()
     root = RootInit(
         root_dir=self.root_dir, allow_existing=True
     )
     repo = Repository(
         RootBind(root), self.xml_state.get_package_manager()
     )
     repo.use_default_location()
     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()
         uri = Uri(repo_source, repo_type)
         repo_source_translated = uri.translate(
             check_build_environment=False
         )
         if not repo_alias:
             repo_alias = uri.alias()
         log.info('Setting up image repository %s', repo_source)
         log.info('--> Type: %s', repo_type)
         log.info('--> Translated: %s', repo_source_translated)
         log.info('--> Alias: %s', repo_alias)
         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
         )
開發者ID:AdamMajer,項目名稱:kiwi-ng,代碼行數:44,代碼來源:setup.py

示例2: setup_repositories

# 需要導入模塊: from kiwi.system.uri import Uri [as 別名]
# 或者: from kiwi.system.uri.Uri import credentials_file_name [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
        )
開發者ID:Conan-Kudo,項目名稱:kiwi,代碼行數:76,代碼來源:prepare.py

示例3: test_credentials_default_file_name

# 需要導入模塊: from kiwi.system.uri import Uri [as 別名]
# 或者: from kiwi.system.uri.Uri import credentials_file_name [as 別名]
 def test_credentials_default_file_name(self):
     uri = Uri(
         'http://example.com/foo',
         'rpm-md'
     )
     assert uri.credentials_file_name() == 'kiwiRepoCredentials'
開發者ID:AdamMajer,項目名稱:kiwi-ng,代碼行數:8,代碼來源:system_uri_test.py

示例4: test_credentials_file_name

# 需要導入模塊: from kiwi.system.uri import Uri [as 別名]
# 或者: from kiwi.system.uri.Uri import credentials_file_name [as 別名]
 def test_credentials_file_name(self):
     uri = Uri(
         'http://example.com/foo?credentials=my_credentials&x=2',
         'rpm-md'
     )
     assert uri.credentials_file_name() == 'my_credentials'
開發者ID:AdamMajer,項目名稱:kiwi-ng,代碼行數:8,代碼來源:system_uri_test.py


注:本文中的kiwi.system.uri.Uri.credentials_file_name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。