aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo in PowerPC pluginBryn M. Reeves2014-04-061-2/+2
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Update references to github URLBryn M. Reeves2014-04-065-6/+6
| | | | | | Update URLs to reflect repository rename to 'sos'. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Convert PowerPC plugin to use add_copy_specs()Bryn M. Reeves2014-04-041-14/+20
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Replace kvm os.popen use with Plugin.call_ext_prog()Bryn M. Reeves2014-04-041-7/+14
| | | | | | | Use call_ext_prog() to mount/umount debugfs and check for errors before running kvm_stat. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Syntax error.. I blame emacs.Adam Stokes2014-04-041-1/+1
| | | | Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Properly state unicode literal in Python 3.2Adam Stokes2014-04-041-1/+1
| | | | | | | The 'u' prefix wasn't reintroduced back into Python 3 until version 3.3. Use six here to accomodate for that. Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Pass byte strings to six.binary_typeBryn M. Reeves2014-04-041-1/+1
| | | | | | Python3 needs a byte string as argument to six.binary_types. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* add python 3.2 for Ubuntu Precise releaseAdam Stokes2014-04-041-0/+1
| | | | Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Use six.binary_type to produce a .decode()able stringBryn M. Reeves2014-04-041-1/+1
| | | | | | | | | Python3 strings do not have a .decode() method. When clearing output for command-not-found case use binary_type("") instead of the empty string. This gives a bytestring on python3 which does support the decode() method. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Use input method from python sixAdam Stokes2014-04-043-6/+10
| | | | | | | | | Something our unittests didnt catch which is more functional than anything. Using raw_input fails on python3 because it was renamed to input. Six provides an alias that handles both cases. Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Fix tuna collection in kernelrtBryn M. Reeves2014-04-041-2/+3
| | | | | | | | | | | The path to the 'head' binary was mangled in the automated PATH conversion (commit e0d132e). It's not required anyway - we might as well grab the entire output. Also remove a useless package check before running the command. Fixes Issue #254. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Clean up sos_get_command_output() and friendsBryn M. Reeves2014-04-047-47/+60
| | | | | | | | | | | | | Returning a 3-tuple has always been ugly. It gets worse as the parameter list for this family of functions grows. Worse, the 3rd member of the tuple is unused and is always set to 0. Rip the whole mess out and return a single, simple dictionary object with 'status' and 'output' keys. Update utilities_tests to reflect the new interface. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Clean up utilities.sos_get_command_output()Bryn M. Reeves2014-04-041-14/+13
| | | | | | | | Remove dead code and clean up the logic in sos_get_command_output. This paves the way for simplifying parameter and return passing in the Plugin command output entry points. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Make forbidden path test a separate functionBryn M. Reeves2014-04-031-4/+7
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix whitespace in Plugin classBryn M. Reeves2014-04-031-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add Plugin.do_path_regex_sub()Bryn M. Reeves2014-04-031-0/+12
| | | | | | | | | | | Add a method to the Plugin class to apply a regex substitution to a set of paths maching a path regex. For e.g.: self.do_path_regex_sub(r'/etc/foo.*', 'pw=(.*)', 'pw=****') The oVirt plugin will use this. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add mail notification to sos-devel in travis configurationBryn M. Reeves2014-04-031-1/+2
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Update cgred configuration file path for RedHatCgroupsBryn M. Reeves2014-04-021-1/+1
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Refactor cgroups pluginBryn M. Reeves2014-04-021-14/+16
| | | | | | | | Move common files from DebianCgroups to Cgroups and drop separate DebianPlugin class. Make add_copy_specs() invocations conform to recommended indent style. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add collection of /var/log/cloud-init.log andLouis Bouchard2014-04-021-0/+1
| | | | | | | | /var/log/cloud-init-output.log if they exist. Closes: #250 Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com> Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* 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>