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

Python resources.pulp_bindings函数代码示例

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

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



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

示例1: run_synchronization

    def run_synchronization(self, progress, cancelled, options):
        """
        Run a repo_sync() on this repository.
        :param progress: A progress report.
        :type progress: pulp_node.progress.RepositoryProgress
        :param options: node synchronization options.
        :type options: dict
        :return: The task result.
        """
        warnings.warn(TASK_DEPRECATION_WARNING, NodeDeprecationWarning)

        bindings = resources.pulp_bindings()
        poller = TaskPoller(bindings)
        max_download = options.get(constants.MAX_DOWNLOAD_CONCURRENCY_KEYWORD, constants.DEFAULT_DOWNLOAD_CONCURRENCY)
        node_certificate = options[constants.PARENT_SETTINGS][constants.NODE_CERTIFICATE]
        key, certificate = Bundle.split(node_certificate)
        configuration = {
            importer_constants.KEY_MAX_DOWNLOADS: max_download,
            importer_constants.KEY_MAX_SPEED: options.get(constants.MAX_DOWNLOAD_BANDWIDTH_KEYWORD),
            importer_constants.KEY_SSL_CLIENT_KEY: key,
            importer_constants.KEY_SSL_CLIENT_CERT: certificate,
            importer_constants.KEY_SSL_VALIDATION: False,
        }
        http = bindings.repo_actions.sync(self.repo_id, configuration)
        if http.response_code != httplib.ACCEPTED:
            raise RepoSyncRestError(self.repo_id, http.response_code)
        # The repo sync is returned with a single sync task in the Call Report
        task = http.response_body.spawned_tasks[0]
        result = poller.join(task.task_id, progress, cancelled)
        if cancelled():
            self._cancel_synchronization(task)
        return result
开发者ID:pulp,项目名称:pulp,代码行数:32,代码来源:model.py


示例2: delete

 def delete(self):
     """
     Delete this distributor.
     """
     bindings = resources.pulp_bindings()
     bindings.repo_distributor.delete(self.repo_id, self.dist_id)
     log.info("Distributor: %s/%s, deleted", self.repo_id, self.dist_id)
开发者ID:pulp,项目名称:pulp,代码行数:7,代码来源:model.py


示例3: _distributors

 def _distributors(self):
     bindings = resources.pulp_bindings()
     http = bindings.server_info.get_distributors()
     if http.response_code == httplib.OK:
         return set([p[TYPE_ID] for p in http.response_body])
     else:
         raise Exception('get distributors failed:%d', http.response_code)
开发者ID:BrnoPCmaniak,项目名称:pulp,代码行数:7,代码来源:validation.py


示例4: purge_orphans

 def purge_orphans():
     """
     Purge orphaned units within the inventory.
     """
     bindings = resources.pulp_bindings()
     http = bindings.content_orphan.remove_all()
     if http.response_code != httplib.ACCEPTED:
         raise PurgeOrphansError(http.response_code)
开发者ID:alanoe,项目名称:pulp,代码行数:8,代码来源:model.py


示例5: add

 def add(self):
     """
     Add this importer to the inventory.
     """
     conf = self.details["config"]
     bindings = resources.pulp_bindings()
     bindings.repo_importer.create(self.repo_id, self.imp_id, conf)
     log.info("Importer %s/%s, added", self.repo_id, self.imp_id)
开发者ID:pulp,项目名称:pulp,代码行数:8,代码来源:model.py


示例6: update

 def update(self, configuration):
     """
     Update this repository-distributor in the inventory.
     :param configuration: The updated configuration.
     :type configuration: dict
     """
     bindings = resources.pulp_bindings()
     bindings.repo_distributor.update(self.repo_id, self.dist_id, configuration)
     log.info("Distributor: %s/%s, updated", self.repo_id, self.dist_id)
开发者ID:pulp,项目名称:pulp,代码行数:9,代码来源:model.py


示例7: purge_orphans

    def purge_orphans():
        """
        Purge orphaned units within the inventory.
        """
        warnings.warn(TASK_DEPRECATION_WARNING, NodeDeprecationWarning)

        bindings = resources.pulp_bindings()
        http = bindings.content_orphan.remove_all()
        if http.response_code != httplib.ACCEPTED:
            raise PurgeOrphansError(http.response_code)
开发者ID:pulp,项目名称:pulp,代码行数:10,代码来源:model.py


示例8: add

 def add(self):
     """
     Add this repository-distributor to the inventory.
     """
     bindings = resources.pulp_bindings()
     bindings.repo_distributor.create(
         self.repo_id,
         self.details['distributor_type_id'],
         self.details['config'],
         self.details['auto_publish'],
         self.dist_id)
     log.info('Distributor: %s/%s, added', self.repo_id, self.dist_id)
开发者ID:alanoe,项目名称:pulp,代码行数:12,代码来源:model.py


示例9: _cancel_synchronization

 def _cancel_synchronization(self, task):
     """
     Cancel a task associated with a repository synchronization.
     :param task: A running task.
     :type task: pulp.bindings.responses.Task
     """
     bindings = resources.pulp_bindings()
     http = bindings.tasks.cancel_task(task.task_id)
     if http.response_code == httplib.ACCEPTED:
         log.info("Task [%s] canceled", task.task_id)
     else:
         log.error("Task [%s] cancellation failed http=%s", task.task_id, http.response_code)
开发者ID:pulp,项目名称:pulp,代码行数:12,代码来源:model.py


示例10: fetch

 def fetch(repo_id, imp_id):
     """
     Fetch the repository-importer from the inventory.
     :return: The fetched importer.
     :rtype: Importer
     """
     try:
         bindings = resources.pulp_bindings()
         http = bindings.repo_importer.importer(repo_id, imp_id)
         details = http.response_body
         return Importer(repo_id, imp_id, details)
     except NotFoundException:
         return None
开发者ID:pulp,项目名称:pulp,代码行数:13,代码来源:model.py


示例11: test_verify_ssl_true

    def test_verify_ssl_true(self, read_config):
        """
        Make sure that verify_ssl is passed correctly when it is true.
        """
        ca_path = '/some/path'
        node_config = {'parent_oauth': {'key': 'some_key', 'secret': 'ssssh!', 'user_id': 'bgates'},
                       'main': {'verify_ssl': 'True', 'ca_path': ca_path}}
        node_config = config.Config(node_config).graph()
        read_config.return_value = node_config

        bindings = resources.pulp_bindings()

        self.assertEqual(bindings.bindings.server.ca_path, ca_path)
        self.assertEqual(bindings.bindings.server.verify_ssl, True)
开发者ID:AndreaGiardini,项目名称:pulp,代码行数:14,代码来源:test_resources.py


示例12: fetch_all

 def fetch_all():
     """
     Fetch all repositories from the inventory.
     :return: A list of: Repository
     :rtype: list
     """
     repositories = []
     bindings = resources.pulp_bindings()
     for repository in bindings.repo_search.search():
         repo_id = repository["id"]
         details = {"repository": repository, "distributors": []}
         r = Repository(repo_id, details)
         repositories.append(r)
     return repositories
开发者ID:pulp,项目名称:pulp,代码行数:14,代码来源:model.py


示例13: add

 def add(self):
     """
     Add the repository and associated plugins.
     """
     # repository
     bindings = resources.pulp_bindings()
     bindings.repo.create(
         self.repo_id,
         self.basic_properties['display_name'],
         self.basic_properties['description'],
         self.basic_properties['notes'])
     # distributors
     for details in self.distributors:
         dist_id = details['id']
         dist = Distributor(self.repo_id, dist_id, details)
         dist.add()
     # importers
     for details in self.importers:
         imp_id = details['id']
         importer = Importer(self.repo_id, imp_id, details)
         importer.add()
     log.info('Repository: %s, added', self.repo_id)
开发者ID:fdammeke,项目名称:pulp,代码行数:22,代码来源:model.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python model.Module类代码示例发布时间:2022-05-25
下一篇:
Python pathlib.url_join函数代码示例发布时间: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