X7ROOT File Manager
Current Path:
/usr/lib/python2.7/site-packages/blivet
usr
/
lib
/
python2.7
/
site-packages
/
blivet
/
📁
..
📄
__init__.py
(117.33 KB)
📄
__init__.pyc
(100.39 KB)
📄
__init__.pyo
(100.39 KB)
📄
arch.py
(9.45 KB)
📄
arch.pyc
(8.63 KB)
📄
arch.pyo
(8.63 KB)
📄
callbacks.py
(3.55 KB)
📄
callbacks.pyc
(1.85 KB)
📄
callbacks.pyo
(1.85 KB)
📄
deviceaction.py
(32.05 KB)
📄
deviceaction.pyc
(33.21 KB)
📄
deviceaction.pyo
(33.21 KB)
📄
devicefactory.py
(63.97 KB)
📄
devicefactory.pyc
(54.57 KB)
📄
devicefactory.pyo
(54.57 KB)
📁
devicelibs
📁
devices
📄
devicetree.py
(117.74 KB)
📄
devicetree.pyc
(82.74 KB)
📄
devicetree.pyo
(82.74 KB)
📄
errors.py
(5.25 KB)
📄
errors.pyc
(12.1 KB)
📄
errors.pyo
(12.1 KB)
📄
fcoe.py
(7.91 KB)
📄
fcoe.pyc
(7.27 KB)
📄
fcoe.pyo
(7.27 KB)
📄
flags.py
(3.89 KB)
📄
flags.pyc
(2.53 KB)
📄
flags.pyo
(2.53 KB)
📁
formats
📄
i18n.py
(1.21 KB)
📄
i18n.pyc
(756 B)
📄
i18n.pyo
(756 B)
📄
iscsi.py
(19.29 KB)
📄
iscsi.pyc
(16.36 KB)
📄
iscsi.pyo
(16.36 KB)
📄
nvdimm.py
(6.24 KB)
📄
nvdimm.pyc
(6.16 KB)
📄
nvdimm.pyo
(6.16 KB)
📄
partitioning.py
(95.65 KB)
📄
partitioning.pyc
(66.5 KB)
📄
partitioning.pyo
(66.5 KB)
📄
partspec.py
(4.05 KB)
📄
partspec.pyc
(3.34 KB)
📄
partspec.pyo
(3.34 KB)
📄
platform.py
(17.38 KB)
📄
platform.pyc
(18.52 KB)
📄
platform.pyo
(18.52 KB)
📄
size.py
(13.47 KB)
📄
size.pyc
(11.4 KB)
📄
size.pyo
(11.4 KB)
📄
storage_log.py
(2.56 KB)
📄
storage_log.pyc
(3.32 KB)
📄
storage_log.pyo
(3.32 KB)
📄
tsort.py
(3.37 KB)
📄
tsort.pyc
(2.38 KB)
📄
tsort.pyo
(2.38 KB)
📄
udev.py
(28.34 KB)
📄
udev.pyc
(30.19 KB)
📄
udev.pyo
(30.19 KB)
📄
util.py
(15.94 KB)
📄
util.pyc
(19.52 KB)
📄
util.pyo
(19.52 KB)
📄
zfcp.py
(16.01 KB)
📄
zfcp.pyc
(13 KB)
📄
zfcp.pyo
(13 KB)
Editing: storage_log.py
import inspect import logging import sys import traceback log = logging.getLogger("blivet") log.addHandler(logging.NullHandler()) def function_name_and_depth(): IGNORED_FUNCS = ["function_name_and_depth", "log_method_call", "log_method_return"] stack = inspect.stack() for i, frame in enumerate(stack): methodname = frame[3] if methodname not in IGNORED_FUNCS: return (methodname, len(stack) - i) return ("unknown function?", 0) def log_method_call(d, *args, **kwargs): classname = d.__class__.__name__ (methodname, depth) = function_name_and_depth() spaces = depth * ' ' fmt = "%s%s.%s:" fmt_args = [spaces, classname, methodname] for arg in args: fmt += " %s ;" fmt_args.append(arg) for k, v in kwargs.items(): fmt += " %s: %s ;" if "pass" in k.lower() and v: v = "Skipped" fmt_args.extend([k, v]) log.debug(fmt, *fmt_args) def log_method_return(d, retval): classname = d.__class__.__name__ (methodname, depth) = function_name_and_depth() spaces = depth * ' ' fmt = "%s%s.%s returned %s" fmt_args = (spaces, classname, methodname, retval) log.debug(fmt, *fmt_args) def log_exception_info(log_func=log.debug, fmt_str=None, fmt_args=None, ignored=True): """Log detailed exception information. :param log_func: the desired logging function :param str fmt_str: a format string for any additional message :param fmt_args: arguments for the format string :type fmt_args: a list of str :param bool ignored: True if no action is taken regarding the exception Note: the logging function indicates the severity level of this exception according to the calling function. log.debug, the default, is the lowest level. Note: If the ignored flag is set, each line of the exception information is prepended with an 'IGNORED' prefix. """ fmt_args = fmt_args or [] (_methodname, depth) = function_name_and_depth() indent = depth * ' ' prefix = 'IGNORED:' + indent if ignored else indent log_func("%sCaught exception, continuing.", prefix) if fmt_str: fmt_str = "%sProblem description: " + fmt_str log_func(fmt_str, prefix, *fmt_args) log_func("%sBegin exception details.", prefix) tb = traceback.format_exception(*sys.exc_info()) for line in (l.rstrip() for entry in tb for l in entry.split("\n") if l): log_func("%s %s", prefix, line) log_func("%sEnd exception details.", prefix)
Upload File
Create Folder