|
Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /usr/src/cloud-init/cloudinit/cmd/devel/ |
Upload File : |
# This file is part of cloud-init. See LICENSE file for license information.
"""Common cloud-init devel commandline utility functions."""
import logging
from cloudinit import log
from cloudinit.helpers import Paths
from cloudinit.stages import Init
def addLogHandlerCLI(logger, log_level):
"""Add a commandline logging handler to emit messages to stderr."""
formatter = logging.Formatter("%(levelname)s: %(message)s")
log.setupBasicLogging(log_level, formatter=formatter)
return logger
def read_cfg_paths() -> Paths:
"""Return a Paths object based on the system configuration on disk."""
init = Init(ds_deps=[])
init.read_cfg()
return init.paths
# vi: ts=4 expandtab