本文整理汇总了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",
示例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
示例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')
示例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.