From 0dde803874917667eb8a98dde4a071fb55bcb244 Mon Sep 17 00:00:00 2001 From: Jose Castillo Date: Mon, 7 Jul 2025 09:26:11 +0100 Subject: [PATCH] [lightspeed] Add new plugin for RH Lightspeed This commit creates the plugin for RHEL Lightspeed Command Line Assistant. Related: RSPEED-549, RHEL-102037, RHEL-122242 Signed-off-by: Jose Castillo --- sos/report/plugins/command_line_assistant.py | 45 ++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 sos/report/plugins/command_line_assistant.py diff --git a/sos/report/plugins/command_line_assistant.py b/sos/report/plugins/command_line_assistant.py new file mode 100644 index 0000000000..c8718a45d2 --- /dev/null +++ b/sos/report/plugins/command_line_assistant.py @@ -0,0 +1,45 @@ +# Copyright (C) 2025 Red Hat, Inc., Jose Castillo + +# This file is part of the sos project: https://github.com/sosreport/sos +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions of +# version 2 of the GNU General Public License. +# +# See the LICENSE file in the source distribution for further information. + +from sos.report.plugins import Plugin, RedHatPlugin, PluginOpt + + +class CommandLineAssistant(Plugin, RedHatPlugin): + + short_desc = 'Lightspeed Command Line Assistant' + + plugin_name = 'command_line_assistant' + profiles = ('ai',) + services = ('clad',) + + option_list = [ + PluginOpt('historydb', default=False, + desc='collect the history database') + ] + + config_file = "/etc/xdg/command-line-assistant/config.toml" + + def setup(self): + self.add_copy_spec([ + self.config_file, + "/etc/systemd/system/clad.service.d/" + ]) + + if self.get_option('historydb'): + self.add_copy_spec( + "/var/lib/command-line-assistant/history.db", + ) + + def postproc(self): + self.do_path_regex_sub(self.config_file, + r"(password\s+=\s+)(\S+)", + r"\1********\n") + +# vim: set et ts=4 sw=4 :