aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Update travis-ci build status imageAdam Stokes2014-04-011-1/+1
| | | | Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Use := with gmake shell function for better optimizationAdam Stokes2014-04-011-5/+5
| | | | | | Also updated the REPO variable to point to new vcs location Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Collect network interfaces flagsMichele Baldessari2014-03-312-1/+3
| | | | | | | | | | | | | | The output of ifconfig or ip link is not enough to understand the full state of the network card flags. In particular IFF_PROMISC is set on a a bridge port-member but that is not displayed via ifconfig nor ip link. See also https://bugzilla.redhat.com/show_bug.cgi?id=199979c#17 why we need to do this. Closes #245 Signed-off-by: Michele Baldessari <michele@acksyn.org> Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Add collection of grub configuration for UEFI systemsBryn M. Reeves2014-03-282-6/+7
| | | | | | | | | | | UEFI systems store the grub configuration at: /boot/efi/EFI/*/grub.conf [grub 1.x] /boot/efi/EFI/*/grub.cfg [grub 2.x] Add these paths to the respective modules. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Raise a TypeError if add_copy_specs() is called with a stringBryn M. Reeves2014-03-272-0/+5
| | | | | | | | | | Since strings are iterable a plugin attempting to call add_copy_specs("/something") results in a plugin calling add_copy_spec("/"). Raise a TypeError if this happens. Fixes Issue #141. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add tests for Plugin.add_copy_spec()/add_copy_specs()Bryn M. Reeves2014-03-271-2/+24
| | | | | | Give add_copy_spec() and add_copy_specs() their own test cases. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Update Plugin tests to treat copy_paths as a setBryn M. Reeves2014-03-271-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Use a set for Plugin.copy_pathsBryn M. Reeves2014-03-271-8/+6
| | | | | | | | | We want to remove any duplicates from the list of paths to collect. Use a set and update it with the expansion of each copy spec as we add it. This avoids having to explictly test for duplicates when we come to iterate over the set. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove references to 'sub' parameter from plugin testsBryn M. Reeves2014-03-271-7/+3
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove 'sub' parameter from Plugin.add_copy_spec*()Bryn M. Reeves2014-03-271-32/+17
| | | | | | | | | | The 'sub' parameter to these functions allowed substituting part of the path in the generated archive. E.g. transforming 'etc/' into 'configs/'. This has never been used and seems to serve no real purpose today. Simplify the parameter passing and copy_spec lists by removing this support. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Drop RedHatPlugin from procenvBryn M. Reeves2014-03-271-2/+2
| | | | | | | The procenv package is not shipped in Red Hat distributions so remove the RedHatPlugin tagging class from it. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Update plugin_tests.py to match new method namesBryn M. Reeves2014-03-271-5/+5
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove obsolete checksum reference from utilities_tests.pyBryn M. Reeves2014-03-271-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Refactor Plugin.collect() pathwayBryn M. Reeves2014-03-271-23/+34
| | | | | | | | | | | | | | Clean up and refactor the collect() path in preparation for fixing the recursive tree copying code. - Move string and command collection into their own methods - Move glob expansion from add_copy_spec*() to collect_copy_specs() - Rename do_copy_file_or_dir() to do_copy_path() There are no functional changes as a result of this patch. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix x86 arch detection in processor pluginBryn M. Reeves2014-03-271-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Pythonify Plugin._path_in_pathlist()Bryn M. Reeves2014-03-271-4/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Clean up package checks in processor pluginBryn M. Reeves2014-03-271-12/+6
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Replace self.policy().pkg_by_name() us in Logs pluginBryn M. Reeves2014-03-271-1/+1
| | | | | | Use self.is_installed() for simple package presence tests. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Convert infiniband to package listBryn M. Reeves2014-03-271-5/+1
| | | | | | | Remove infiniband's open-coded check_enabled() and use a package list to control plugin activation. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Dead code removal: PluginExceptionBryn M. Reeves2014-03-261-5/+0
| | | | | | Defined but never used. Delete. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Dead code removal: sos.plugins.common_prefix()Bryn M. Reeves2014-03-261-13/+0
| | | | | | Unused. Delete. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add vim tags to all python source filesBryn M. Reeves2014-03-26165-2/+330
| | | | | | Fixes Issue #243. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Dead code removal: utilities.checksum()Bryn M. Reeves2014-03-262-27/+0
| | | | | | Has test case but no callers. Delete it. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Dead code removal: DirTreeBryn M. Reeves2014-03-262-99/+1
| | | | | | | The DirTree class has remained unused since it was implemented. Remove the definition and associated test cases. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Dead code removal: sos_relative_path()Bryn M. Reeves2014-03-262-31/+1
| | | | | | | The function is defined and even has test cases. But no callers.. Remove the function and the test cases that exercise it. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove --profile supportBryn M. Reeves2014-03-254-71/+3
| | | | | | | | | | | | | The handrolled profile logging support in sos hasn't been widely used in a long time and is a problem better solved with external profiling and coverage tools. Rip out all the support and documentation. This shortens and simplifies numerous Plugin class methods. Fixes Issue #244. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix plugin_test exception on six.PY2Bryn M. Reeves2014-03-251-2/+2
| | | | | | | Replace explicit test for six.PY2 with try/exception handling of StringIO import. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Call rhsm-debug with the --sos switchBryn M. Reeves2014-03-201-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Do not collect isos in cobbler pluginAdam Stokes2014-03-141-0/+1
| | | | | | In Ubuntu isos are being added to the tarball, do not do that. Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Match plugins against policiesBryn M. Reeves2014-03-133-26/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes Issue #238. When tagging classes are used to enable plugins on multiple platforms it is possible for there to be more than one valid class instance for a given policy. For e.g.: class DebianFooPlugin(Plugin, DebianPlugin): /// class UbuntuFooPlugin(Plugin, UbuntuPlugin): /// Since UbuntuPolicy includes both DebianPlugin and UbuntuPlugin in its valid_subclasses list both classes pass the validity test and both are added to the loaded_plugins list. This causes plugins to run twice: 2014-03-12 19:57:50,974 DEBUG: copying file /var/log/mail.log to /var/log/mail.log 2014-03-12 19:57:50,975 DEBUG: added /var/log/mail.log to FileCacheArchive /tmp/sosreport-u1210-vm1-20140312195750 2014-03-12 19:57:51,293 DEBUG: copying file /var/log/mail.log to /var/log/mail.log 2014-03-12 19:57:51,294 DEBUG: added /var/log/mail.log to FileCacheArchive /tmp/sosreport-u1210-vm1-20140312195750 Fix this by adding a match_plugin() method to the policy base class and prefer plugins that are subclasses of the first entry in the list. This patch also reverses the order of the valid_subclasses list for the UbuntuPolicy to ensure preference is given to native plugins: self.valid_subclasses = [UbuntuPlugin, DebianPlugin] Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Update policy_tests.py for validate_plugin changeBryn M. Reeves2014-03-131-4/+4
| | | | | | | The policy_tests unit tests call validatePlugin(). Update them to use the new name. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Rename validatePlugin to validate_pluginBryn M. Reeves2014-03-122-2/+2
| | | | | | | | This one somehow didn't get the memo about camelCase not being cool any more in sos. Rename the method to comply with pep8 and not be so ugly. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix broken binary detection in satellite pluginBryn M. Reeves2014-03-121-3/+2
| | | | | | | | | | The satellite plugin attempts to check for the existence of the 'satellite-debug' binary before running it. This was broken by the mass conversion to PATH for running external commands. Remove the check and just attempt to run the command regardless. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Clean up get_cmd_path/make_cmd_path/make_cmd_dirs messBryn M. Reeves2014-03-128-36/+18
| | | | | | | | | | | | | | | | | | Clean up the Plugin helper methods for handling command output paths. This better matches the proposal in Issue #181 and simplifies code for plugins that need to generate their own paths under sos_commands/<plugin>/. - Rename get_cmd_path() to get_cmd_output_path() - Add an optional 'name' parameter to specify a subdirectory name in the plugin's sos_commands/<plugin>/ directory. - Default to creating directories if they do not exist Finally fix up all existing users of get_cmd_path() to use the new interface and remove handrolled uses of os.path.join(...) for generating these paths. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add tuned pluginPeter Portante2014-03-121-0/+30
| | | | | | | Resolves Issue #232. Signed-off-by: Peter Portante <peter.portante@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Update systemd supportBryn M. Reeves2014-03-121-2/+3
| | | | | | | | - Drop support for 'systemctl dump' as this no longer exists. - Add 'systemctl list-units' for convenience - add systemctl show-environment Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Merge pull request #235 from leeyarwood/masterBryn M. Reeves2014-03-111-25/+0
|\ | | | | | | | | Remove the rhevm plugin. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
| * Remove the rhevm plugin.Lee Yarwood2014-03-041-25/+0
| | | | | | | | | | | | | | | | | | | | This functionality is now provided by the ovirt-log-collector project [1] and independently shipped VDSM sos plugin [2]. [1] http://gerrit.ovirt.org/gitweb?p=ovirt-log-collector.git [2] http://gerrit.ovirt.org/gitweb?p=vdsm.git;a=tree;f=vdsm/sos;hb=HEAD Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
* | Fix remaining use of obsolete 'get_cmd_dir()' in pluginsBryn M. Reeves2014-03-112-2/+2
| | | | | | | | | | | | | | The get_cmd_dir() method was renamed to get_cmd_path(). Fix the two remaining uses in yum and cluster plugins. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Add PowerNV specific debug dataVasant Hegde2014-03-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | This patch adds support to collect more debug files on PowerNV platform. Signed-off-by: Vasant Hegde <hegdevasant linux vnet ibm com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com> --- sos/plugins/powerpc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
* | powerpc: Move VPD related tool under common codeVasant Hegde2014-03-111-3/+4
|/ | | | | | | | | | | | | VPD related tools (lsvpd, lscfg, lsmcode) is supported on both pSeries and PowerNV platform. Hence moving these commands under common code. Also added support to grab vpd database (/var/lib/lsvpd). Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> --- sos/plugins/powerpc.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
* Replace package check with file check in anacronBryn M. Reeves2014-03-031-2/+4
| | | | | | | | The anacron facility may be provided by packages named 'anacron', 'chronie-anacron' etc. They all use a common /etc/anacrontab file so check for this instead. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Scrub ldap_default_authtok password in sssd pluginBryn M. Reeves2014-02-141-1/+9
| | | | | | | | The file sssd.conf collected by the sssd plugin may contain an ldap password. Add a postproc() method to replace the string with blanks. Signed-off-by: Bryn M. Reeeves <bmr@redhat.com>
* Eliminate hard-coded /var/log/sa paths in sar pluginBryn M. Reeves2014-02-141-3/+3
| | | | | | | | | The Sar plugin classes define a self.sa_path - use it consistently throughout the plugin when generating strings containing the path. Suggested by David Kutalek. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove useless check_enabled() from sar pluginBryn M. Reeves2014-02-141-8/+0
| | | | | | | | | | The sar plugin implemented a check_enabled() to catch cases where the plugin is force-enabled on a system with no sar installation. This is better handled by runtime checking in setup() which the plugin also does. Kill the check and its annoying error message. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Improve error message when cluster.crm_from is invalidBryn M. Reeves2014-02-111-1/+2
| | | | | | | | | | | | | | | If a user passes a non-date string value as the crm_from parameter of the cluster plugin an error message is logged: crm_from parameter 'True' is not a valid date The plugin continues to run and uses the default value (T-72hrs) as the value of crm_from. Make this clear in the message displayed to users: crm_from parameter 'True' is not a valid date: using default Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix command output substitution exceptionBryn M. Reeves2014-02-111-3/+4
| | | | | | | | | | | | If a comand has a substitution registered via do_cmd_output_sub() but no data was collected (e.g. command not found) the postproc code will throw an exception as the return value ('replacements') is never assigned. Initialise replacements to None before scanning the list of run commands and return this if no substitutions were made. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add distupgrade pluginBryn M. Reeves2014-02-101-0/+39
| | | | | | | | | | Add a new plugin to collect data relating to completed or attempted distribution upgrades. Currently supports the Red Hat set of tools and files but other distributions can supply their own filelists or override setup() to perform other distribution specific actions. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix gluster volume name extractionBryn M. Reeves2014-02-101-1/+1
| | | | | | | | | The get_volume_names() function in the gluster plugin tries to extract volume names from the output of the "gluster volume info" command using a slice range. The range start should be 12 to account for the "Volume Name:" label at the start of the line. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Ensure unused fds are closed when calling subprocesses via PopenBryn M. Reeves2014-02-044-4/+10
| | | | | | | | | | When sos communicates with a child process using Popen all IO takes place on stdin/stdout/stderr (or a subset). No other open file descriptors should be inherited by the child. Make all calls to Popen set close_fds=True. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>