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

Python util.getLogger函数代码示例

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

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



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

示例1: import

from pulp.server.exceptions import MissingResource

from pulp_rpm.common.constants import (
    SCRATCHPAD_DEFAULT_METADATA_CHECKSUM,
    CONFIG_DEFAULT_CHECKSUM,
    CONFIG_KEY_CHECKSUM_TYPE,
    REPO_AUTH_CONFIG_FILE,
    PUBLISH_HTTP_KEYWORD,
    PUBLISH_HTTPS_KEYWORD,
)
from pulp_rpm.common.ids import TYPE_ID_DISTRIBUTOR_YUM
from pulp.repoauth import protected_repo_utils, repo_cert_utils
from pulp_rpm.yum_plugin import util


_LOG = util.getLogger(__name__)

REQUIRED_CONFIG_KEYS = ("relative_url", "http", "https")

OPTIONAL_CONFIG_KEYS = (
    "gpgkey",
    "auth_ca",
    "auth_cert",
    "https_ca",
    "checksum_type",
    "http_publish_dir",
    "https_publish_dir",
    "protected",
    "skip",
    "skip_pkg_tags",
    "generate_sqlite",
开发者ID:goosemania,项目名称:pulp_rpm,代码行数:31,代码来源:configuration.py


示例2: is_valid_prefix

import isodate
from pulp.common import dateutils
from pulp.server.db.model.criteria import UnitAssociationCriteria
from pulp.server.exceptions import MissingResource
from pulp.server.managers.repo.distributor import RepoDistributorManager
from pulp.server.managers.repo.query import RepoQueryManager

from pulp_rpm.common import constants, ids
from pulp_rpm.plugins.db import models
from pulp_rpm.plugins.distributors.export_distributor import generate_iso
from pulp_rpm.yum_plugin import comps_util, updateinfo, metadata
from pulp_rpm.yum_plugin import util as yum_utils


_logger = yum_utils.getLogger(__name__)

ISO_NAME_REGEX = re.compile(r"^[_A-Za-z0-9-]+$")
ASSOCIATED_UNIT_DATE_KEYWORD = "created"


def is_valid_prefix(file_prefix):
    """
    Used to check if the given file prefix is valid. A valid prefix contains only letters, numbers, _,
    and -

    :param file_prefix: The string used to prefix the export file(s)
    :type  file_prefix: str

    :return: True if the given file_prefix is a valid match; False otherwise
    :rtype:  bool
开发者ID:pgustafs,项目名称:pulp_rpm,代码行数:30,代码来源:export_utils.py


示例3: import

import os
from xml.etree import ElementTree

from pulp_rpm.plugins.distributors.yum.metadata.metadata import (
    MetadataFileContext, REPO_DATA_DIR_NAME)
from pulp_rpm.yum_plugin import util


_logger = util.getLogger(__name__)

UPDATE_INFO_XML_FILE_NAME = 'updateinfo.xml.gz'


class UpdateinfoXMLFileContext(MetadataFileContext):

    def __init__(self, working_dir, checksum_type=None):

        metadata_file_path = os.path.join(working_dir, REPO_DATA_DIR_NAME, UPDATE_INFO_XML_FILE_NAME)
        super(UpdateinfoXMLFileContext, self).__init__(metadata_file_path, checksum_type)

    def _write_root_tag_open(self):

        updates_element = ElementTree.Element('updates')
        bogus_element = ElementTree.SubElement(updates_element, '')

        updates_tags_string = ElementTree.tostring(updates_element, 'utf-8')
        bogus_tag_string = ElementTree.tostring(bogus_element, 'utf-8')
        opening_tag, closing_tag = updates_tags_string.split(bogus_tag_string, 1)

        self.metadata_file_handle.write(opening_tag + '\n')
开发者ID:asmacdo,项目名称:pulp_rpm,代码行数:30,代码来源:updateinfo.py


示例4: getLogger

# -*- coding: utf-8 -*-

import os
import commands
import datetime
import tempfile
from stat import ST_SIZE

from pulp_rpm.yum_plugin.util import getLogger


log = getLogger(__name__)

# Define the size (in megabytes) of a DVD sized ISO
DVD_ISO_SIZE = 4380

MKISOFS_COMMAND_TEMPLATE = "mkisofs -r -D -graft-points -path-list %s -o %s"


def create_iso(target_dir, output_dir, prefix, image_size=DVD_ISO_SIZE, progress_callback=None):
    """
    Run the export process.

    :param target_dir:          The directory to be written to ISO images
    :type  target_dir:          str
    :param output_dir:          destination directory where the ISO images are written
    :type  output_dir:          str
    :param prefix:              prefix for the ISO file names; usually includes a repo id
    :type  prefix:              str
    :param image_size:          The maximum size of the image in bytes. Defaults to a dvd sized
    image.
开发者ID:ATIX-AG,项目名称:pulp_rpm,代码行数:31,代码来源:generate_iso.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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