Last active
November 9, 2021 21:26
-
-
Save Glutexo/adf245185852455866012e8d27ecfcdd to your computer and use it in GitHub Desktop.
Data Collector patch for Insights Core to limit collection only to a single file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: insights/client/data_collector.py | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
diff --git a/insights/client/data_collector.py b/insights/client/data_collector.py | |
--- a/insights/client/data_collector.py (revision 42907d96132d4877ac588e6aa090b0cd4adbfcf1) | |
+++ b/insights/client/data_collector.py (date 1636398517420) | |
@@ -320,6 +320,13 @@ | |
rm_commands = rm_conf.get('commands', []) | |
rm_files = rm_conf.get('files', []) | |
+ conf['commands'] = [] | |
+ conf['globs'] = [] | |
+ conf['files'] = filter( | |
+ lambda file: file['symbolic_name'] == 'sshd_config', | |
+ conf['files'] | |
+ ) | |
+ | |
for c in conf['commands']: | |
# remember hostname archive path | |
if c.get('symbolic_name') == 'hostname': |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment