3 ܓi @s6ddlmZddlmZmZmZGdddeeZdS))glob)Plugin RedHatPlugin PluginOptc@s<eZdZdZdZd ZdZeddddgZdd Z d d Z d S)WatchdogzWatchdog information.watchdogsystemz conf-filez/etc/watchdog.confzwatchdog config file)defaultZdesccCsd}t|dddd}x\|D]T}|jddj}y(|jdd\}}|jd krV|j}Wqtk rlYqXqWWdQRX|S) aGet watchdog log directory. Get watchdog log directory path configured in ``conf_file``. :returns: The watchdog log directory path. :returntype: str. :raises: IOError if ``conf_file`` is not readable. NrzUTF-8)encoding#r=zlog-dir)opensplitstrip ValueError)self conf_filelog_dirZconf_flinekeyvaluer/usr/lib/python3.6/watchdog.py get_log_dirs    zWatchdog.get_log_dircCs|j|jd}|jd}|j|dg|jddgy|j|}|rJ|}Wn8tk r}z|jd|d|WYdd}~XnX|jd rt|j|d }n t|j|d t|j|d }|j|x&t|jd D]}|jd|qWdS)zCollect watchdog information. Collect configuration files, custom executables for test-binary and repair-binary, and stdout/stderr logs. z conf-filez/var/log/watchdogz/etc/sysconfig/watchdogz/etc/watchdog.dz/usr/libexec/watchdog/scriptszCould not read z: NZall_logs*z*.stdoutz*.stderrz/dev/watchdog*zwdctl )Z path_joinZ get_optionZ add_copy_specrIOErrorZ _log_warnrZadd_cmd_output)rrrresZexZ log_filesZdevrrrsetup4s*  (  zWatchdog.setupN)r)r) __name__ __module__ __qualname__Z short_descZ plugin_nameZprofilesZpackagesrZ option_listrrrrrrrs rN)rZsos.report.pluginsrrrrrrrr s