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

Python config.read_json_config函数代码示例

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

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



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

示例1: entry_point

def entry_point():
    """
    This method allows us to announce this importer to the Pulp Platform.

    :return: importer class as its config
    :rtype:  tuple
    """
    return ISOImporter, config_utils.read_json_config(CONF_FILENAME)
开发者ID:dokuhebi,项目名称:pulp_rpm,代码行数:8,代码来源:importer.py


示例2: entry_point

def entry_point():
    """
    Entry point that pulp platform uses to load the importer
    :return: importer class and its config
    :rtype:  Importer, dict
    """
    plugin_config = read_json_config(constants.IMPORTER_CONFIG_FILE_NAME)
    return DockerImporter, plugin_config
开发者ID:daviddavis,项目名称:pulp_docker,代码行数:8,代码来源:importer.py


示例3: entry_point

def entry_point():
    """
    Entry point that pulp platform uses to load the importer
    :return: importer class and its config
    :rtype:  Importer, dict
    """
    config = read_json_config(constants.IMPORTER_CONFIG_FILE_PATH)
    return WebImporter, config
开发者ID:beav,项目名称:pulp_deb,代码行数:8,代码来源:web.py


示例4: test_read_json_config

    def test_read_json_config(self, mock_open, exists):
        exists.return_value = True
        mock_open.return_value.read.return_value = '{"foo":"bar"}'

        config = read_json_config("server/foo")
        mock_open.assert_called_once_with('/etc/pulp/server/foo', 'r')

        self.assertEqual(config, {'foo': 'bar'})
开发者ID:BrnoPCmaniak,项目名称:pulp,代码行数:8,代码来源:test_common_config_validation.py


示例5: entry_point

def entry_point():
    """
    Entry point that pulp platform uses to load the importer
    :return: importer class and its config
    :rtype:  Importer, {}
    """
    plugin_config = read_json_config(CONF_FILENAME)
    return PuppetModuleImporter, plugin_config
开发者ID:kimjohansen,项目名称:pulp_puppet,代码行数:8,代码来源:importer.py


示例6: entry_point

def entry_point():
    """
    Entry point that pulp platform uses to load the importer
    :return: importer class and its config
    :rtype:  Importer, dict
    """
    plugin_config = read_json_config(constants.IMPORTER_CONFIG_RELATIVE_PATH)
    return OpenstackImageImporter, plugin_config
开发者ID:bowlofeggs,项目名称:pulp_openstack,代码行数:8,代码来源:importer.py


示例7: entry_point

def entry_point():
    """
    Entry point that pulp platform uses to load the distributor
    :return: distributor class and its config
    :rtype:  Distributor, dict
    """
    plugin_config = copy.deepcopy(PLUGIN_DEFAULT_CONFIG)
    edited_config = read_json_config(constants.DISTRIBUTOR_CONFIG_FILE_PATH)
    plugin_config.update(edited_config)
    return WebDistributor, plugin_config
开发者ID:pcreech,项目名称:pulp_ostree,代码行数:10,代码来源:web.py


示例8: entry_point

def entry_point():
    config = read_json_config(CONF_FILE_PATH)
    return GroupISODistributor, config
开发者ID:dkliban,项目名称:pulp_rpm,代码行数:3,代码来源:groupdistributor.py


示例9: read_json_config

from pulp.plugins.config import PluginCallConfiguration
from pulp.server.db.connection import get_collection
from pulp.server.managers.repo import _common as common_utils
from pulp_rpm.plugins.distributors.yum.publish import Publisher


YUM_DISTRIBUTOR_ID = 'yum_distributor'

REPO_WORKING_DIR = '/var/lib/pulp/working/%s/distributors/' + YUM_DISTRIBUTOR_ID

OLD_ROOT_PUBLISH_DIR = '/var/lib/pulp/published'
OLD_HTTP_PUBLISH_DIR = os.path.join(OLD_ROOT_PUBLISH_DIR, 'http', 'repos')
OLD_HTTPS_PUBLISH_DIR = os.path.join(OLD_ROOT_PUBLISH_DIR, 'https', 'repos')

NEW_DISTRIBUTOR_CONF_FILE_PATH = 'server/plugins.conf.d/%s.json' % YUM_DISTRIBUTOR_ID
NEW_DISTRIBUTOR_CONF = read_json_config(NEW_DISTRIBUTOR_CONF_FILE_PATH)


def migrate(*args, **kwargs):
    """
    For each repository with a yum distributor, clean up the old yum distributor's
    mess and re-publish the repository with the new distributor.
    """

    distributor_collection = get_collection('repo_distributors')
    yum_distributors = list(distributor_collection.find({'distributor_type_id': YUM_DISTRIBUTOR_ID}))

    repo_collection = get_collection('repos')
    repo_ids = list(set(d['repo_id'] for d in yum_distributors))
    repos = dict((r['id'], r) for r in repo_collection.find({'id': {'$in': repo_ids}}))
开发者ID:pombredanne,项目名称:rcm-pulp-rpm,代码行数:30,代码来源:0015_new_yum_distributor.py


示例10: entry_point

def entry_point():
    config = read_json_config(CONF_FILE_PATH)
    return YumHTTPDistributor, config
开发者ID:AndreaGiardini,项目名称:pulp_rpm,代码行数:3,代码来源:distributor.py


示例11: entry_point

def entry_point():
    config = read_json_config(CONF_FILE_PATH)
    return ISORsyncDistributor, config
开发者ID:pcreech,项目名称:pulp_rpm,代码行数:3,代码来源:distributor.py


示例12: entry_point

def entry_point():
    return WinImporter, config_utils.read_json_config(CONF_FILENAME)
开发者ID:lsjostro,项目名称:pulp_win,代码行数:2,代码来源:importer.py


示例13: test_read_json_config_non_existent_file

 def test_read_json_config_non_existent_file(self):
     config = read_json_config("bad/file/name")
     self.assertEqual(config, {})
开发者ID:BrnoPCmaniak,项目名称:pulp,代码行数:3,代码来源:test_common_config_validation.py


示例14: test_read_json_config_prepended_slash_in_path

 def test_read_json_config_prepended_slash_in_path(self, mock_open, exists):
     exists.return_value = True
     mock_open.return_value.read.return_value = '{"foo":"bar"}'
     read_json_config("/server/foo")
     mock_open.assert_called_once_with('/etc/pulp/server/foo', 'r')
开发者ID:BrnoPCmaniak,项目名称:pulp,代码行数:5,代码来源:test_common_config_validation.py


示例15: read_json_config

import logging
import os

from pulp.common.config import read_json_config
from pulp_rpm.plugins.distributors.yum import configuration
from pulp_rpm.common.ids import TYPE_ID_DISTRIBUTOR_YUM


_logger = logging.getLogger(__name__)


CONF_FILE_PATH = 'server/plugins.conf.d/%s.json' % TYPE_ID_DISTRIBUTOR_YUM
config = read_json_config(CONF_FILE_PATH)


def walk_and_clean_directories(base_directory):
    """
    Walk through all of the directories inside of the base dir and clean the orphaned directories.
    The leaves should be directories with a listing file and a symlink. If there is no symlink,
    the directory is part of the relative url of a repo that has been deleted and it should be
    removed.

    :param base_directory: directory to search for orphaned directories
    :type  base_directory: str

    :raises: OSError can occur if migration occurs durring a concurrent publish
    """

    for path, dirs, files in os.walk(base_directory):
        is_orphan = not dirs and (files == ['listing'] or files == [])
        if is_orphan and path != base_directory:
开发者ID:ATIX-AG,项目名称:pulp_rpm,代码行数:31,代码来源:0021_clean_http_directories.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python dateutils.format_iso8601_datetime函数代码示例发布时间:2022-05-25
下一篇:
Python json.loads函数代码示例发布时间: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