https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/uaclient/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/uaclient/yaml.py
import logging
import sys

from uaclient import util
from uaclient.messages import BROKEN_YAML_MODULE, MISSING_YAML_MODULE

LOG = logging.getLogger(util.replace_top_level_logger_name(__name__))

try:
    import yaml
except ImportError as e:
    LOG.exception(e)
    print(MISSING_YAML_MODULE, file=sys.stderr)
    sys.exit(1)


def safe_load(stream):
    try:
        return yaml.safe_load(stream)
    except AttributeError as e:
        LOG.exception(e)
        print(BROKEN_YAML_MODULE.format(path=yaml.__path__), file=sys.stderr)
        sys.exit(1)


def safe_dump(data, stream=None, **kwargs):
    try:
        return yaml.safe_dump(data, stream, **kwargs)
    except AttributeError as e:
        LOG.exception(e)
        print(BROKEN_YAML_MODULE.format(path=yaml.__path__), file=sys.stderr)
        sys.exit(1)


parser = yaml.parser

https://t.me/RX1948 - 2025