powerpc: Move VPD related tool under common code

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(-)
Add PowerNV specific debug data

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(-)
Fix remaining use of obsolete 'get_cmd_dir()' in plugins

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>
Merge pull request #235 from leeyarwood/master

Remove the rhevm plugin.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Update systemd support

- 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>
Add tuned plugin

Resolves Issue #232.

Signed-off-by: Peter Portante <peter.portante@redhat.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Clean up get_cmd_path/make_cmd_path/make_cmd_dirs mess

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>
Fix broken binary detection in satellite plugin

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>
Rename validatePlugin to validate_plugin

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>
Update policy_tests.py for validate_plugin change

The policy_tests unit tests call validatePlugin(). Update them to
use the new name.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Match plugins against policies

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>
Do not collect isos in cobbler plugin

In Ubuntu isos are being added to the tarball, do not do that.

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
Call rhsm-debug with the --sos switch

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Fix plugin_test exception on six.PY2

Replace explicit test for six.PY2 with try/exception handling of
StringIO import.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Remove --profile support

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>
Dead code removal: sos_relative_path()

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>
Dead code removal: DirTree

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: utilities.checksum()

Has test case but no callers. Delete it.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Add vim tags to all python source files

Fixes Issue #243.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Dead code removal: sos.plugins.common_prefix()

Unused. Delete.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>