aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [ovn_host] catch ovn2.*-host packagesDaniel Alvarez2019-11-141-1/+1
| | | | | | | | After splitting OVN from OVS, new packages exist for ovn which should be taken into account by the relevant plugins. Signed-off-by: Daniel Alvarez <dalvarez@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [python] Add hashes option, refactor Python vs. RedHatPythonBissenbay2019-11-141-8/+55
| | | | | | | | | | | | | | | | Adds a new `hashes` option to the `python` plugin. When specified, this option will generate a hash for every python file discovered in the `/usr/lib*` and `/usr/local/lib*` canonical paths. This information is then written to the archive as `digests.json` Additionally, refactors the differences between the base `Python` and `RedHatPython` classes when dealing with the system-default python installation. Resolves: #1801 Signed-off-by: Bissenbay Dauletbayev <bissenbay@gmail.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [crio] Gate crictl commands by package predicateJake Hunsaker2019-11-141-4/+9
| | | | | | | | The `crictl` utility is provided by cri-tools, which is not required for a base crio installation. If the -tools package is not installed, skip attmepting to collect crictl output. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openstack_keystone] implement exec_cmd API changePavel Moravec2019-11-141-2/+3
| | | | | | | | | | Since e8bb94c, exec_cmd returns a dict instead of command output. Reflect the change in testing the return value and using the output. Resolves: #1860 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [redhat] Update cantboot preset to use profilesJake Hunsaker2019-11-141-4/+6
| | | | | | | | | | | | | Updates the 'cantboot' preset to use existing profiles, rather than specifying each plugin and having to maintain that list in the policy. Now 'cantboot' enables the boot, storage, and system profiles - it also will now enable the boot.all-images, rpm.rpmva, and rpm.rpmdb plugin options. Resolves: #1818 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ssh] Add plugin to 'system' profileJake Hunsaker2019-11-141-1/+1
| | | | | | Related: #1818 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [apport] List var crash recursivelyEric Desrochers2019-11-131-1/+1
| | | | | | | | | | | | | | | Listing /var/crash recursively will provide not only the root of /var/crash as current state, but also data found in subdirectories if any as follow: $ ls /var/crash/201911131119/ dmesg.201911131119 dump.201911131119 Resolves: #1861 Signed-by-off: Eric Desrochers <eric.desrochers@canonical.com> Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [lxd] Add detection when lxd is installed as a snap.Eric Desrochers2019-11-131-0/+1
| | | | | | | | | | | | | | | | | Conventional deb package extracts lxd binary in /usr/bin/lxd, while snap extracts lxd binary in /snap/bin/lxd. More and more Ubuntu integrates mechanisms to convert DEB to SNAP (especially for Canonical products such as juju, lxd, canonical-livepatch) during release upgrade. Meaning sosreport should be capable to detect both installation types. Resolves: 1855 Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com> Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [kubernetes] no longer need to hardcode snap pathEric Desrochers2019-11-131-1/+1
| | | | | | | '/snap/bin' has been added into the Ubuntu policy PATH environment. Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com>
* [policies] Add PATH for UbuntuEric Desrochers2019-11-131-0/+2
| | | | | | | | Add PATH for Ubuntu policies and integrate /snap/bin, preventing to hardcode the patch inside the plugins if installed as a snap. Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com>
* [foreman,katello] move relicts of katello plugin to foremanPavel Moravec2019-11-132-66/+4
| | | | | | | | | | | | | Katello plugin does not further collect any katello-related data. qpid-stat was moved to pulp, (foreman) table sizes to foreman and /var/log/httpd/katello-reverse-proxy* belong to foreman-proxy. Move the latest bit to foreman and drop katello plugin. Resolves: #1843 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [virsh] add new path collection of virt-manager logsMORISHIMA Shigeki2019-11-131-4/+4
| | | | | | | | | | | The path of virt-manager logs was changed from "/root/.virt-manager/" to "/root/.cache/virt-manager". New path collection is added to virsh plugin. Resolves: #1851 Signed-off-by: MORISHIMA Shigeki <s.morishima@fujitsu.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [pcp] Fix FileNotFoundError exceptionJose Castillo2019-11-131-1/+1
| | | | | | | | | | | | | After API command consolidation via commit e8bb94c and commit e51d3e6, pcp started throwing a FileNotFound exception since the plugin treats the command output as the name of a path to open. Remove the open and just use the content of the 'output' entry directly. Resolves: #1852 Signed-off-by: Jose Castillo <jose.mfcastillo@gmail.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [kubernetes] Set plugin_namePavel Moravec2019-11-131-0/+1
| | | | | | | | | | | | | Without setting plugin_name in parent class, "sosreport --list-plugins" prints plugin name based on the child class name (redhatkubernetes, ubuntukubernetes). Trying to refer that plugin name fails. Setting plugin_name to "kubernetes" in the parent Kubernetes class prevents this confusion. Resolves: #1858 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [man] describe --allow-system-changes (#1850)Pavel Moravec2019-11-121-0/+4
| | | | | | | | | In #1435, --allow-system-changes option was added that is documented in sosreport --help but not in manpages. Resolves: #1850 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
* [Plugin|Policy] Only call lsmod once and standardize kmod checksPavel Moravec2019-11-122-13/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit makes two changes to how sos deals with kernel modules and their state during a run of sosreport. First, no longer call `lsmod` for every individual plugin during its enablement check. Instead, call `lsmod` only once during `Policy` initialization, and cache the output for later checks. Second, have `Plugin.is_module_loaded()` check for kmod presence in the saved policy class attr for kernel_mods, rather than checking through `/proc/modules`. Have the plugin enablement checks now also use `is_module_loaded()` to standardize with how `SoSPredicate`s are checked. Note that this change results in a significant performance increase for sos initialization times in a RHEL 7 container. Resolves: #1854 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
| * [Plugin|Policy] Only call lsmod once and standardize kmod checksJake Hunsaker2019-11-112-13/+8
|/ | | | | | | | | | | | | | | | | | | | | | This commit makes two changes to how sos deals with kernel modules and their state during a run of sosreport. First, no longer call `lsmod` for every individual plugin during its enablement check. Instead, call `lsmod` only once during `Policy` initialization, and cache the output for later checks. Second, have `Plugin.is_module_loaded()` check for kmod presence in the saved policy class attr for kernel_mods, rather than checking through `/proc/modules`. Have the plugin enablement checks now also use `is_module_loaded()` to standardize with how `SoSPredicate`s are checked. Note that this change results in a significant performance increase for sos initialization times in a RHEL 7 container. Resolves: #1854 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [vdsm] fix directory blacklist styleBryn M. Reeves2019-11-041-2/+2
| | | | | | | Plugins must use 'path/to/exclude' rather than 'path/to/exclude/*' in order to omit a directory and all its content from the report. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [openstack_octavia] fix directory blacklist styleBryn M. Reeves2019-11-041-1/+1
| | | | | | | Plugins must use 'path/to/exclude' rather than 'path/to/exclude/*' in order to omit a directory and all its content from the report. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [libreswan] fix directory blacklist styleBryn M. Reeves2019-11-041-1/+1
| | | | | | | Plugins must use 'path/to/exclude' rather than 'path/to/exclude/*' in order to omit a directory and all its content from the report. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [ceph] fix directory blacklist styleBryn M. Reeves2019-11-041-2/+2
| | | | | | | Plugins must use 'path/to/exclude' rather than 'path/to/exclude/*' in order to omit a directory and all its content from the report. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] improve _copy_dir() variable namingBryn M. Reeves2019-11-041-3/+4
| | | | | | | Directory entries found in _copy_dir() may be either files or sub-directories: reflect this in the names of local variables. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] use correct source path when copying directoriesBryn M. Reeves2019-11-041-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [tests] fix test_copy_dir_forbidden_pathBryn M. Reeves2019-11-011-1/+2
| | | | | | | | | | Rather than call just Plugin.setup() and Plugin._do_copy_path(), add an add_copy_spec() call to the mock plugin setup() method, and invoke copying by calling the Plugin.collect() method. Related: #1845 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [kernel] remove trailing directory globs in forbidden pathsBryn M. Reeves2019-11-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the forbidden path test now uses an exact match the trailing globs ("/some/directory/path/to/exclude/*") used to exclude trace related directories from collection lead to a failure to properly blacklist these files: The glob is expanded, for e.g.: "/sys/kernel/debug/tracing/per_cpu/*" Expands to unclude a 'cpuN' sub-directory for each CPU present on the machine. These expanded paths are then added to the forbidden paths list for the plugin: /sys/kernel/debug/tracing/per_cpu/cpu0 /sys/kernel/debug/tracing/per_cpu/cpu1 ... When an attempt is made to collect the entire "per_cpu" directory a check is made for the full "/sys/kernel/debug/tracing/per_cpu" path against each entry in the forbidden paths list. Since this is a prefix of the actual paths stored no match is returned and the collection is permitted. Remove the trailing globs from these directory paths and prevent any collection of the directories they reference by the plugin. Related: #1842 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] fix destination paths in _do_copy_path()Bryn M. Reeves2019-11-011-3/+3
| | | | | | | | | | | The path used to copy special device nodes and directories in _do_copy_path() should be the destination path in the archive (without sysroot prefix), and not the source path in the host file system that includes this prefix. Related: #1842 Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [Plugin] remove invalid {strip/join}_sysroot()Pavel Moravec2019-11-011-3/+1
| | | | | | | | | | | Do not strip the sysroot path prefix when calling _do_copy_path() for a symlink target and do not add the sysroot prefix when testing for a forbidden path. Related: #1842 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [kpatch] fix command status typoBryn M. Reeves2019-10-311-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [podman] Collect network information and cert/hooks listJake Hunsaker2019-10-251-1/+11
| | | | | | | | | | | | First, adds collection of a recursive listing of /etc/containers to show which certs and oci hooks may be present. Second, adds collection of podman networking information. Both the output of 'podman network ls' and a subsequent inspect on each network reported are captured. The inspect outputs are saved to the 'networks' subdir. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] RHOSP preset without --all-logsPavel Moravec2019-10-251-4/+2
| | | | | | | | | OpenStack deployments do not need to collect all logs by default. Resolves: #1841 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [grub2] call grub2-config with --no-grubenv-update when appropriatePavel Moravec2019-10-252-3/+11
| | | | | | | | | | | | On some newer grub2 versions, grub2-config removes extra args in $kernel_opts until --no-grubenv-update option is used. Test if the option is present in "grub2-config --help" and if so, use it. Resolves: #1682 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [plugins] extend SoSPredicate by command output inclusion testPavel Moravec2019-10-251-8/+49
| | | | | | | | | | | | | | | Add a predicate type in form cmd_outputs={'cmd': 'foo --help', 'output': 'bar'} that checks whether output of given command contains given string. Multiple commands/outputs can be provided in a list. Related to: #1682 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Predicate] Override __bool__ to allow py3 evaluationJake Hunsaker2019-10-241-0/+5
| | | | | | | | | | | | | | | | | | | The check in `Plugin.test_predicate()` relies on a 'is not None' test, which on py2 invokes a call to `SoSPredicate.__nonzero__()` which in turns runs our evaluation of the predicate. On py3 however, this test is an explicit check to see if the object is `NoneType`. As such, `__nonzero__()` never runs and the predicate defaults to always evaluating ad `True`. This effectively removed any gating for command execution on py3. By overriding `SoSPredicate.__bool__()` to wrap `__nonzero__()` we can ensure that predicate evaluation is performed properly on both py2 and py3 runtimes. Closes: #1839 Resolves: #1840 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [subscription_manager] obfuscate proxy password in rhsm.confPavel Moravec2019-10-231-0/+5
| | | | | | | | | | | Obfuscate proxy password in /etc/rhsm/rhsm.conf on line: proxy_password = someSecret Resolves: #1837 Signed-off-by: Pavel Moravec <pmoravec@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [archive] remove obsolete TarFile wrapperBryn M. Reeves2019-10-231-77/+1
| | | | | | | | | | | The _TarFile wrapper in sos.archive is only needed for python 2.6 and earlier: remove it since we no longer support this version. Closes: #1834 Resolves: #1838 Signed-off-by: Bryn M. Reeves <bmr@redhat.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [redhat] Automatically enable cantboot preset in emergency/rescue modeJake Hunsaker2019-10-231-0/+4
| | | | | | | | | | If sos is being run in emergency or rescue mode on a RH family system, then automatically load the cantboot preset by default, instead of other package-based presets. Resolves: #1831 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] fix plugin option regression (c4d06c5)Bryn M. Reeves2019-10-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | Commit c4d06c5 fixes an LGTM warning about the placement of the else clause in the for loop of Plugin.set_option() but introduces a regression setting valid plugin options: # sosreport -vv --batch --debug --build -k rpm.rpmva=on sosreport (version 3.8) set sysroot to '/' (default) [plugin:ovn_central] could not run 'podman ps': command not found [plugin:ovn_central] could not run 'docker ps': command not found no such option "rpmva" for plugin (rpm) no such option "rpmva" for plugin (rpm) The 'else' here is invalid: rather than applying to the existing if statement inside the loop body the 'return False' should happen unconditionally if the loop exits without finding any match. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [plugins] remove unused globstr variable from do_cmd_private_subPavel Moravec2019-10-231-1/+0
| | | | | | globstr is assigned but never used Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [reporting] Fix html report to make it compliantMikel Olasagasti Uranga2019-10-141-9/+7
| | | | | | | | | Also, removed link to donot.css as it doesn't exist. Resolves: #1830 Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [policies] update vendor URLs to use HTTPSMikel Olasagasti Uranga2019-10-143-6/+6
| | | | | | | Resolves: #1829 Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [build] update spec file URLs to use HTTPSMikel Olasagasti Uranga2019-10-141-1/+1
| | | | | Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [doc] update documentation URLs to use HTTPSMikel Olasagasti Uranga2019-10-143-10/+10
| | | | | | | Related: #1829 Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [pcp] fix pmloger_ls output processingBryn M. Reeves2019-10-141-2/+2
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [sosrport] only import sos.plugins onceBryn M. Reeves2019-10-141-3/+2
| | | | | | | | | | Remove the from import of 'import_plugin()', and use a single import for the whole of 'sos.plugins' in sos.sosreport. Resolves: #1828 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* [InitSystem] Move load_all_services() out from base __init__()Jake Hunsaker2019-10-141-2/+1
| | | | | | | | Moves the call to load_all_services() out from the base __init__() of InitSystem() and into SystemdInit(), as highlighted by LGTM.com analysis. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [lgtm] Remove unused importsJake Hunsaker2019-10-143-5/+0
| | | | | | Removes several unused imports identified by LGTM. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [kimchi] Remove unused log-size checkJake Hunsaker2019-10-141-1/+0
| | | | | | | Removes a check against the log-size option that is not subsequently used later in the plugin. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [openstack_cinder] Blacklist /etc/cinder/volumesJake Hunsaker2019-10-141-0/+1
| | | | | | | | | | Adds a blacklist to prevent sos from trying to copy volumes when those volumes are configured to be saved under /etc/cinder/volumes. Fixes: #1056 Resolves: #1827 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [kubernetes] Only use kubeconfig file if file is presentJake Hunsaker2019-10-141-1/+3
| | | | | | | | | Updates the plugin for Red Hat systems to only use the OCP kubeconfig file, /etc/origin/master/admin.kubeconfig, if it is actually present. Resolves: #1826 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [nfsganesha] Collect rotated logs when using --all-logsJake Hunsaker2019-10-141-0/+4
| | | | | | | | | If --all-logs is specified, the nfsganesha plugin will now gather the rotated log files from /var/log/ganesha, not just the current log file. Fixes: #1016 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>