aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [build] Bump version to 4.5.14.5.1Jake Hunsaker2023-03-013-4/+7
| | | | | | This commit marks the release of sos-4.5.1 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [testing] Grab snap build logs on failureArif Ali2023-03-011-0/+5
| | | | Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [ostree] Collect "ostree fsck" under plugin specific optPavel Moravec2023-02-271-2/+5
| | | | | | | | | | Collect "ostree fsck" via the plugin specific option, not via --verify option. Relevant: rhbz#2161533 Resolves: #3147 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [presets] drop --verify from RHOCP presetPavel Moravec2023-02-271-2/+2
| | | | | | | | There is no need to have that option enabled by default for RHOCP. Relevant: #3147 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [composer] Capure /etc/osbuild-composer fileJose Castillo2023-02-241-1/+2
| | | | | | | | | | | /etc/osbuild-composer contains customizations users create for Image Builder. This directory is not currently owned by any package but if present, it, and all files inside, should be gathered as well. Related: RHBZ#2169776 Signed-off-by: Jose Castillo <jcastillo@redhat.com>
* [report] Print work outcome even in quiet modePavel Moravec2023-02-242-4/+13
| | | | | | | | | | sos report should print generated sosreport directory or tarball or etimate of size even with --quiet option. Resolves: #3142 Closes: #3143 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [microshift] Add MicroShift OVN pluginPablo Acevedo Montserrat2023-02-231-0/+47
| | | | Signed-off-by: Pablo Acevedo Montserrat <pacevedo@redhat.com>
* [microshift] Add MicroShift pluginPablo Acevedo Montserrat2023-02-231-0/+167
| | | | Signed-off-by: Pablo Acevedo Montserrat <pacevedo@redhat.com>
* [rhui] Obfuscate registry_password from answers filesPavel Moravec2023-02-221-1/+1
| | | | | | | | | | registry_passwords occur in rhui-tools.conf (#3138) but also in (backups of) answers.yaml files. Relevant: #3138 Resolves: #3140 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [rhui] Obfuscate registry_password in rhui-tools.confPavel Moravec2023-02-211-0/+4
| | | | | | | | | Scrub registry_password value in /etc/rhui/rhui-tools.conf Relevant: rhbz#2170893 Resolves: #3138 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [tests] Add version consistency testJake Hunsaker2023-02-171-2/+12
| | | | | | | | | | Commits a downstream test from RHEL to ensure that a given release has a consistent version string in the UI report, manifest, and most importantly for the package nvr for an sos package built from the current branch. Note that this test is only implemented for RPM installations at this time. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [tests] Add test for #3071Pavel Moravec2023-02-161-1/+8
| | | | | | | | Add test for #3071 : Prevent obfuscating tmpDir Resolves: #3136 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [tests] Add test for AD username obfuscationPavel Moravec2023-02-151-0/+8
| | | | | | | | | Add unit test for #3030. Relevant: #3030 Resolves: #3135 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [ceph] add iSCSI gatewayNobuto Murata2023-02-101-0/+36
| | | | | | | | | | Along with existing Ceph plugins, Ceph iSCSI gateway use case requires additional config and log files to be analyzed. https://docs.ceph.com/en/latest/rbd/iscsi-overview/ Closes: #3098 Related-Bug: https://bugs.launchpad.net/ubuntu/+source/sosreport/+bug/2000672 Signed-off-by: Nobuto Murata <nobuto.murata@canonical.com>
* [azure] Update curl command for Azure MetadataToshi Aoyama2023-02-081-2/+2
| | | | | | | | - add `--noproxy` option - update api-version to `2021-01-01` - add query parameter `format=json` Signed-off-by: Toshi Aoyama <toaoyama@microsoft.com>
* Avoid overwrite symbolic link for a command outputFernando Royo2023-02-081-3/+6
| | | | | | | | | | | | | | | | Every output of a command run on a container is saved in the sos_commands folder, also additionally a symbolic link is created from the sos_container folder to link the container where it was run to the output file. When there is a duplicated command on the list to be run on the container, the symbolic link creation will fail due to file already exists error. To avoid this error we can trust on the check_path method, that will give us a clue avoid if the file already exists or not to continue with the symbolic link creation. Signed-off-by: Fernando Royo <froyo@redhat.com>
* [snap][testing] Fix bionic snap runtimeArif Ali2023-02-085-3/+16
| | | | | | | | | | | | | | | | | | | | When the snap is being packaged via core22, it used python3.10 but bionic used python3.6 and seems have runtime issues there. Added the sos alias for testing, to ensure that when the stage one testing is done, that sos is correctly tested within the snap This alternative ensures that the packaging module is packaged in the snap, and can use this if the pkg_resources version does not work Add a wrapper function in utlities, so that the parse_version can be used in a consistent way across the sos project Closes: #3126 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* Remove duplicate commandsFernando Royo2023-02-071-6/+3
| | | | | | | | | | | | When a list of command are sent to run on a container the output is printed to file on sos_commands/<plugin> folder, but also a symbolic link is created from the sos_container/<container> file to the sos_commands/<plugin> file. When a command is duplicated, we get an exception on the plugin and the rest of commands are not executed. This patch removes some hardcoded commands, and clean the list from duplicated commands before sending to the container.
* [tags] Add insights specific tagsRyan Blakley2023-02-0676-138/+338
| | | | | | | | | * Added missing tags for plugins to match insights spec names, so they can be queried by insights when loading an archive. This will aid in spec loading via the manifest instead of defining the specs individually as we do now. Signed-off-by: Ryan Blakley <rblakley@redhat.com>
* [build] Bump version to 4.5.04.5.0Jake Hunsaker2023-02-013-4/+7
| | | | | | This commit marks the release of sos-4.5.0. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ceph_common] Update log patterns for multiple ceph versionsJake Hunsaker2023-01-311-3/+3
| | | | | | | | | Updates the log patterns for `ceph_common` to handle Ceph versions that use or don't use fsid's as part of the logging paths. Related: #3122 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ceph] Accommodate both running on host and containersNobuto Murata2023-01-303-82/+22
| | | | | | | | | | | Simplify the log collection condition by introducing a file glob. It can capture logs from both existing clusters such as package based deployments and container based deployments such as cephadm. Closes: #3100 Co-authored-by: Samuel Walladge <samuel.walladge@canonical.com> Signed-off-by: Nobuto Murata <nobuto.murata@canonical.com>
* [redhat] Failover to SFTP credentials prompt when no caseidPavel Moravec2023-01-271-5/+13
| | | | | | | | | When no case id is provided during upload, a prompt of username must fail over to SFTP upload. Relevant: #3117 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [policies] set case_id before prompting for upload credentialsPavel Moravec2023-01-271-3/+11
| | | | | | | | | Since prompting for upload username/password relies on case_id for some policies, let fully set case_id before that. Resolves: #3117 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [test] Add stage 2 test for ipv6 obfuscationMiroslav Hradilek2023-01-274-0/+68
| | | | | | Relates: #3060 Signed-off-by: Miroslav Hradilek <mhradile@redhat.com>
* [cleaner] Improve separating host from IPv6 addressPavel Moravec2023-01-261-6/+3
| | | | | | | | | | Fix a corner case in separating host address from an IPv6 address when the host string is (substring of) the network address string. Resolves: #3121 Relevant: #3120 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [Policy] Add logging mechanism to PolicyJake Hunsaker2023-01-234-41/+44
| | | | | | | | | | | | | | | | This commit allows `Policy` to inherit the logging streams used by the rest of sos. With this commit, this is primarily the `ui_log` in order to report info and error level messages to the console. As was discovered earlier, avocado and potentially other automation may sometimes miss `print()` output, and so we should consistently use the logging mechanism. Future commits may be expected to enhace debug logging of Policy functionality. See also: #3106 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [collector] add saltstack transportTrevor Benson2023-01-203-1/+148
| | | | Signed-off-by: Trevor Benson <trevor.benson@gmail.com>
* [policy] Update new debian versionsArif Ali2023-01-191-6/+21
| | | | | | | | | | | | | | | | | | Add all the new versions since 7, and update name/versions based on https://wiki.debian.org/DebianReleases. Checked latest bookworm and the release string was in /etc/debian_version, but /etc/debian_version was inconsistent on other versions. /etc/lsb-release didnt exist by default. grab the codename from /etc/os-release and base the versions from there forky and trixie and not out yet, but added as per the releases page for future proofing. Closes: #2691 Signed-off-by: Arif Ali <arif.ali@canonical.com>
* [foreman_openscap] Add foreman OpenSCAP client pluginPavel Moravec2023-01-191-0/+26
| | | | | | | | | Collect /etc/foreman_scap_client/config.yaml on any Foreman OpenSCAP client system. Resolves: #3115 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [cirrus] Update GCP imagesJake Hunsaker2023-01-161-11/+11
| | | | | | | | | | Update most of the GCE images we use for CI testing to their latest releases for their respective versions. This commit also replaces F35 testing with F37 beta. F35 is now EOL and as such no future sos releases would be included there. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [sosnode] Use `parse_version()` to replace `LooseVersion()`Jake Hunsaker2023-01-162-4/+5
| | | | | | | | | | Switch to using `parse_version()` from setuptools instead of `LooseVersion()` from distutils, since distutils is being removed in python 3.12. Related: #3093 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [build] Convert to setuptoolsJake Hunsaker2023-01-164-90/+13
| | | | | | | | | | | | | | | | | | | | In python 3.12 distutils will be removed. As such, we need to update to the replacement `setuptools`. This commit makes the basic change over in `setup.py`, so that an `sdist` source tarball can be generated. Note that while this source tarball will still have the `.po` files in it any build tarball (`bdist`) produced via the new `setup.py` will *not* have `.mo` translation files compiled and included at this point. In reviewing this change, it was found that our internationalization is currently broken and very out of date. Future work will focus on fixing that situation, but for now the immediate packaging needs are being addressed. Resolves: #3093 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [utilities] Enhance timeout mechanismJunius Gao2023-01-162-1/+3
| | | | | | | Enhance on timeout mechanism. Force the parent process to exit when it has a deadlock child. Signed-off-by: Junius Gao <Junius.Gao@veritas.com>
* [testing] Change location of mocked files for testsJake Hunsaker2023-01-1229-22/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, mocked files were kept under the `tests/test_data/` directory and generally mimic'd the file location they would be temporarily copied to during the execution of their relevant tests. This has a few maintainability drawbacks, and the handling of the `files` attribute for test cases as either strings or tuples is at best confusing. Improve on this by instead making the `files` references relative to where the test case file is written. This enables easier maintenance by keeping all test requirements closer together, rather than spread across the repo. As such, the `files` attribute now requires a list of tuples, taking the form `(relative_src, absolute_dest)`. Additionally, fake plugins for tests that need them to artificially test a specific criteria should also be included in the test's subdir now. Along with this change, move several StageTwo tests to their own subdirs that now contain both the test cases and the needed files for mocking. This should be the new design pattern going forward - if a test needs to mock files of any kind, put it in a new subdirectory (and if it doesn't need to mock files, continue to keep it in the relevant directory within the test suite). Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ceph_mon] collect mon status on octopusNikhil Kshirsagar2023-01-111-1/+1
| | | | Signed-off-by: Nikhil Kshirsagar <nikhil.kshirsagar@canonical.com>
* Replace deprecated Logger.warn by Logger.warningPavel Moravec2023-01-118-14/+15
| | | | | | Resolves: #3109 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [cleaner] Convert print()s to leveraging ui loggingJake Hunsaker2023-01-111-10/+14
| | | | | | | | | | | | It was recently found that some condition will cause Avocado to not capture trailing `print()` statements in our test suite, and it is reasonable to assume other automation may also have similar edge cases. Resolve this by switching potentially problematic `print()`s to use the ui logging stream, which will still print to console even after the file handler has been closed. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] Add policy for OpenCloudOSzoedong2023-01-091-0/+42
| | | | Signed-off-by: zoedong <zoedong@tencent.com>
* [policies] Directly use a Transport for remote commandsJake Hunsaker2023-01-093-19/+55
| | | | | | | | | | | | | | | | | | | Previously, remote command executions handled by policies were done by moodifying the command string based on the `remote_exec` property of the given `SoSTransport` in use for the node that the policy was loaded for. While this worked well for SSH connections, newer transports may need to do some manipulation of returned data in order for the rest of `sos collect` to function as intended. As such, switch to directly using a transport's `run_command()` method, which will ideally handle any needed manipulations of either how the command is execute and/or how the returned data is presented to the calling component. Related: #3087 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [Plugin] Fix docstring in add_copy_specSamuel Walladge2023-01-091-2/+2
| | | | | | | The string or list strings in the param `copyspecs` are processed as globs, not regular expressions. Signed-off-by: Samuel Walladge <samuel.walladge@canonical.com>
* fix typolilinjie2023-01-091-1/+1
| | | | Signed-off-by: lilinjie <lilinjie@uniontech.com>
* [collector] Prevent appending local host in strict_node_list modePavel Moravec2023-01-051-6/+8
| | | | | | | | | | | | The changes in respecting strict_node_list are three-fold: 1) Don't add local hostname among "list of nodes to collect from:" 2) Skip explicit adding of the primary node to client_list 3) Apply strict_node_list to reduce_node_list (as it can purge away hostname or IP address of the local host, otherwise) Resolves: #3096 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
* [ceph_mgr] Update plugin for newer versions of CephJake Hunsaker2023-01-031-45/+73
| | | | | | | Updates the plugin to account for newer versions of Ceph, similar to the previous few commits focusing on the ceph plugins. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ceph_osd] Update plugin for newer versions of cephJake Hunsaker2023-01-031-41/+70
| | | | | | | | | | | | Newer versions of Ceph, such as for RHCS 5, make some changes to the container names as well as how to leverage `ceph daemon` commands. Update the plugin to reflect this, and use the available admin sockets on the host to capture that output, rather than always running it inside the osd container. Further, account for the use of an fsid in directory paths for newer ceph. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ceph_mon] Update plugin for newer ceph versionsJake Hunsaker2023-01-031-58/+141
| | | | | | | | | | | | | | | | Newer versions of ceph do not have running processes directly on the node. As such, the current method of determining the ID for the `ceph tell` commands is not functional. Fix this by using the output of `ceph status` on RHCS 5 nodes to get the node IDs. Further, while ceph containers can be used to enable this plugin, those containers by default cannot run various `ceph` commands collected by the plugin. However, those commands are functional directly on the host, so no longer attempt to execute within the containers. Finally, update `postproc()` for newer versions as well. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ceph_*] Correct enablement trigger for ceph pluginsJake Hunsaker2023-01-036-27/+11
| | | | | | | | | | | | | | | | | The previous changes that broke up the ceph plugin into smaller component specific plugins inadvertently broke the plugin enablement by overriding the `check_enabled()` function to check for file presence under a directory. This in turn replaced the standard checks, such as the presence of certain containers. Fix this by removing the method override, and leveraging the `files` tuple against the component-specific directory into which the globs were trying to check. Further, update the container name regexes for enablement as they have changed slightly since the initial plugin creation. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [ceph] Add new collect clust profile for RHCS5Jake Hunsaker2023-01-021-0/+67
| | | | | | | | | | Adds a new cluster profile for RHCS 5 for `sos collect`. This profile depends upon the use of `cephadm` which is used to both deploy and manage the cluster. Users may optionally restrict the list of nodes to collect from by using the `-c ceph.labels` option to specify a set of label(s) to filter node results with. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [clusters] Allow cluster profiles to specify sos options directlyJake Hunsaker2023-01-023-14/+37
| | | | | | | | | | | | | | | Clusters can already pass plugin options to nodes, and can also set arbitrary options on individual nodes or primary nodes. So, rather than requiring a cluster profile specify sos options to both nodes and primaries, instead allow profiles to specify options via a simple `sos_options` dict that will get applied to every node automatically, as is the case with plugin options. Note that user values for these options will override cluster values. For example, if a cluster spceifies a `--log-size` value, and the user does on the command line, then the user's value will have precedence. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
* [policies] Add policy for Circle LinuxBella Zhang2023-01-021-0/+49
| | | | | | Circle Linux is an production-ready distribution from RHEL. Signed-off-by: Bella Zhang <bella@cclinux.org>