o id> @s6ddlmZmZmZddlmZGdddeeZdS))Plugin RedHatPlugin PluginOpt)globc@s<eZdZdZdZdZdZeddddgZd d Z d d Z d S)WatchdogzWatchdog information.watchdog)system)r conf_filez/etc/watchdog.confzwatchdog config file)defaultdescc Csd}t|d4}|D](}|dd}z|dd\}}|dkr(|}Wq ty2Yq wWd|S1s>wY|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. Nr#r=zlog-dir)opensplitstrip ValueError)selfr log_dirconf_flinekeyvaluer=/usr/lib/python3/dist-packages/sos/report/plugins/watchdog.py get_log_dirs"      zWatchdog.get_log_dirc Cs||d}|d}||dg|ddgz ||}|r%|}WntyA}z|d||fWYd}~nd}~ww|drPt||d }nt||d t||d }||t|d D] }|d |qldS)zCollect watchdog information. Collect configuration files, custom executables for test-binary and repair-binary, and stdout/stderr logs. r z/var/log/watchdogz/etc/sysconfig/watchdogz/etc/watchdog.dz/usr/libexec/watchdog/scriptszCould not read %s: %sNall_logs*z*.stdoutz*.stderrz/dev/watchdog*zwdctl %s) path_join get_option add_copy_specrIOError _log_warnradd_cmd_output)rr rresex log_filesdevrrrsetup4s8    zWatchdog.setupN) __name__ __module__ __qualname__ short_desc plugin_nameprofilespackagesr option_listrr)rrrrrs rN)sos.report.pluginsrrrrrrrrrs