# Path: crmsh/report/utillib.py
# class Tempfile(object):
#     def __init__(self):
#     def add(self, filename):
#     def drop(self):
# def add_tempfiles(filename):
# def _mkdir(directory):
# def arch_logs(logf, from_time, to_time):
# def analyze():
# def analyze_one(workdir, file_):
# def base_check():
# def booth_info():
# def check_backtraces(workdir):
# def check_crmvfy(workdir):
# def check_env():
# def check_if_log_is_empty():
# def check_logs(workdir):
# def check_permissions(workdir):
# def check_time(var, option):
# def cib_diff(file1, file2):
# def cluster_info():
# def generate_collect_functions():
# def collect_info():
# def collect_journal(from_t, to_t, outf):
# def compatibility_pcmk():
# def consolidate(workdir, f):
# def create_tempfile(time=None):
# def date():
# def diff_check(file1, file2):
# def get_distro_info():
# def dump_log(logf, from_line, to_line):
# def dump_logset(logf, from_time, to_time, outf):
# def dump_state(workdir):
# def events(destdir):
# def find_decompressor(log_file):
# def find_files(dirs, from_time, to_time):
# def find_files_all(name, path):
# def find_first_ts(data):
# def filter_lines(data, from_line, to_line):
# def finalword():
# def find_getstampproc(log_file):
# def find_getstampproc_raw(line):
# def find_log():
# def find_ssh_user():
# def findln_by_time(data, ts):
# def find_binary_for_core(corefile):
#     def findbin(fname):
#         def isexec(filename):
# def print_core_backtraces(flist):
# def get_cib_dir():
# def get_command_info(cmd):
# def get_command_info_timeout(cmd, timeout=5):
#     def kill(process):
# def get_conf_var(option, default=None):
# def get_crm_daemon_dir():
# def get_dirname(path):
# def get_local_ip():
# def get_log_vars():
# def get_nodes():
# def get_peer_ip():
# def get_ocf_dir():
# def get_pe_state_dir():
# def get_pkg_mgr():
# def get_stamp_legacy(line):
# def get_stamp_rfc5424(line):
# def get_stamp_syslog(line):
# def get_ts(line):
# def grep(pattern, infile=None, incmd=None, flag=None):
# def grep_file(pattern, infile, flag):
# def grep_row(pattern, indata, flag):
# def head(n, indata):
# def is_conf_set(option, subsys=None):
# def is_exec(filename):
# def is_our_log(logf, from_time, to_time):
# def line_time(data_list, line_num):
# def load_ocf_dirs():
# def log_fatal(msg):
# def log_size(logf, outf):
# def make_temp_dir():
# def mktemplate(argv):
# def node_needs_pwd(node):
# def pe_to_dot(pe_file):
# def pick_compress():
# def pick_first(choice):
# def pkg_ver_deb(packages):
# def pkg_ver_pkg_info(packages):
# def pkg_ver_pkginfo(packages):
# def pkg_ver_rpm(packages):
# def pkg_versions(packages):
# def print_log(logf):
# def print_logseg(logf, from_time, to_time):
# def ra_build_info():
# def random_string(num):
# def sanitize():
# def sanitize_one(in_file):
# def parse_sanitize_rule(rule_string):
# def say_ssh_user():
# def sed_inplace(filename, pattern, repl):
# def set_env():
# def stdchannel_redirected(stdchannel, dest_filename):
# def start_slave_collector(node, arg_str):
# def str_to_bool(v):
# def tail(n, indata):
# def test_ssh_conn(addr):
# def dump_D_process():
# def lsof_ocfs2_device():
# def touch_r(src, dst):
# def ts_to_dt(timestamp):
# def txt_diff(file1, file2):
# def verify_deb(packages):
# def verify_packages(packages):
# def verify_pkg_info(packages):
# def verify_pkginfo(packages):
# def verify_rpm(packages):
# def which(prog):
# def get_open_method(infile):
# def read_from_file(infile):
# def write_to_file(tofile, data):
# def get_sensitive_key_value_list():
# def extract_sensitive_value_list(rule):
# def include_sensitive_data(data):
# def sub_sensitive_string(data):
#     INVERT = False
#     SHOWNUM = False
#             INVERT = True
#             SHOWNUM = True


from builtins import str
from crmsh.report import utillib
import os
import pwd
import hashlib
import platform
import crm_script
#!/usr/bin/python3
from __future__ import unicode_literals
data = crm_script.get_input()

PACKAGES = ['booth', 'cluster-glue', 'corosync', 'crmsh', 'csync2', 'drbd',
            'fence-agents', 'gfs2', 'gfs2-utils', 'ha-cluster-bootstrap',
            'haproxy', 'hawk', 'libdlm', 'libqb', 'ocfs2', 'ocfs2-tools',
            'pacemaker', 'pacemaker-mgmt', 'resource-agents', 'sbd']


def rpm_info():
    return crm_script.rpmcheck(PACKAGES)


def logrotate_info():
    return {}


def get_user():
    return pwd.getpwuid(os.getuid()).pw_name


def sys_info():
    sysname, nodename, release, version, machine = os.uname()
    # The first three columns measure CPU and IO utilization of the
    # last one, five, and 15 minute periods. The fourth column shows
    # the number of currently running processes and the total number of
    # processes. The last column displays the last process ID used.
    system, node, release, version, machine, processor = platform.uname()

# Path: crmsh/report/utillib.py
# class Tempfile(object):
#     def __init__(self):
#     def add(self, filename):
#     def drop(self):
# def add_tempfiles(filename):
# def _mkdir(directory):
# def arch_logs(logf, from_time, to_time):
# def analyze():
# def analyze_one(workdir, file_):
# def base_check():
# def booth_info():
# def check_backtraces(workdir):
# def check_crmvfy(workdir):
# def check_env():
# def check_if_log_is_empty():
# def check_logs(workdir):
# def check_permissions(workdir):
# def check_time(var, option):
# def cib_diff(file1, file2):
# def cluster_info():
# def generate_collect_functions():
# def collect_info():
# def collect_journal(from_t, to_t, outf):
# def compatibility_pcmk():
# def consolidate(workdir, f):
# def create_tempfile(time=None):
# def date():
# def diff_check(file1, file2):
# def get_distro_info():
# def dump_log(logf, from_line, to_line):
# def dump_logset(logf, from_time, to_time, outf):
# def dump_state(workdir):
# def events(destdir):
# def find_decompressor(log_file):
# def find_files(dirs, from_time, to_time):
# def find_files_all(name, path):
# def find_first_ts(data):
# def filter_lines(data, from_line, to_line):
# def finalword():
# def find_getstampproc(log_file):
# def find_getstampproc_raw(line):
# def find_log():
# def find_ssh_user():
# def findln_by_time(data, ts):
# def find_binary_for_core(corefile):
#     def findbin(fname):
#         def isexec(filename):
# def print_core_backtraces(flist):
# def get_cib_dir():
# def get_command_info(cmd):
# def get_command_info_timeout(cmd, timeout=5):
#     def kill(process):
# def get_conf_var(option, default=None):
# def get_crm_daemon_dir():
# def get_dirname(path):
# def get_local_ip():
# def get_log_vars():
# def get_nodes():
# def get_peer_ip():
# def get_ocf_dir():
# def get_pe_state_dir():
# def get_pkg_mgr():
# def get_stamp_legacy(line):
# def get_stamp_rfc5424(line):
# def get_stamp_syslog(line):
# def get_ts(line):
# def grep(pattern, infile=None, incmd=None, flag=None):
# def grep_file(pattern, infile, flag):
# def grep_row(pattern, indata, flag):
# def head(n, indata):
# def is_conf_set(option, subsys=None):
# def is_exec(filename):
# def is_our_log(logf, from_time, to_time):
# def line_time(data_list, line_num):
# def load_ocf_dirs():
# def log_fatal(msg):
# def log_size(logf, outf):
# def make_temp_dir():
# def mktemplate(argv):
# def node_needs_pwd(node):
# def pe_to_dot(pe_file):
# def pick_compress():
# def pick_first(choice):
# def pkg_ver_deb(packages):
# def pkg_ver_pkg_info(packages):
# def pkg_ver_pkginfo(packages):
# def pkg_ver_rpm(packages):
# def pkg_versions(packages):
# def print_log(logf):
# def print_logseg(logf, from_time, to_time):
# def ra_build_info():
# def random_string(num):
# def sanitize():
# def sanitize_one(in_file):
# def parse_sanitize_rule(rule_string):
# def say_ssh_user():
# def sed_inplace(filename, pattern, repl):
# def set_env():
# def stdchannel_redirected(stdchannel, dest_filename):
# def start_slave_collector(node, arg_str):
# def str_to_bool(v):
# def tail(n, indata):
# def test_ssh_conn(addr):
# def dump_D_process():
# def lsof_ocfs2_device():
# def touch_r(src, dst):
# def ts_to_dt(timestamp):
# def txt_diff(file1, file2):
# def verify_deb(packages):
# def verify_packages(packages):
# def verify_pkg_info(packages):
# def verify_pkginfo(packages):
# def verify_rpm(packages):
# def which(prog):
# def get_open_method(infile):
# def read_from_file(infile):
# def write_to_file(tofile, data):
# def get_sensitive_key_value_list():
# def extract_sensitive_value_list(rule):
# def include_sensitive_data(data):
# def sub_sensitive_string(data):
#     INVERT = False
#     SHOWNUM = False
#             INVERT = True
#             SHOWNUM = True


# Path: scripts/health/collect.py
from builtins import str
from crmsh.report import utillib
import os
import pwd
import hashlib
import platform
import crm_script

#!/usr/bin/python3
from __future__ import unicode_literals
data = crm_script.get_input()

PACKAGES = ['booth', 'cluster-glue', 'corosync', 'crmsh', 'csync2', 'drbd',
            'fence-agents', 'gfs2', 'gfs2-utils', 'ha-cluster-bootstrap',
            'haproxy', 'hawk', 'libdlm', 'libqb', 'ocfs2', 'ocfs2-tools',
            'pacemaker', 'pacemaker-mgmt', 'resource-agents', 'sbd']


def rpm_info():
    return crm_script.rpmcheck(PACKAGES)


def logrotate_info():
    return {}


def get_user():
    return pwd.getpwuid(os.getuid()).pw_name


def sys_info():
    sysname, nodename, release, version, machine = os.uname()
    # The first three columns measure CPU and IO utilization of the
    # last one, five, and 15 minute periods. The fourth column shows
    # the number of currently running processes and the total number of
    # processes. The last column displays the last process ID used.
    system, node, release, version, machine, processor = platform.uname()

    distname = utillib.get_distro_info()