Add collection of /var/log/cloud-init.log and
/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>
Refactor cgroups plugin

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>
Update cgred configuration file path for RedHatCgroups

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Add mail notification to sos-devel in travis configuration

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Add Plugin.do_path_regex_sub()

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>
Fix whitespace in Plugin class

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Make forbidden path test a separate function

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Clean up utilities.sos_get_command_output()

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>
Clean up sos_get_command_output() and friends

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>
Fix tuna collection in kernelrt

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>
Use input method from python six

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>
Use six.binary_type to produce a .decode()able string

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>
add python 3.2 for Ubuntu Precise release

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
Pass byte strings to six.binary_type

Python3 needs a byte string as argument to six.binary_types.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Properly state unicode literal in Python 3.2

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>
Syntax error.. I blame emacs.

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
Replace kvm os.popen use with Plugin.call_ext_prog()

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>
Convert PowerPC plugin to use add_copy_specs()

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Update references to github URL

Update URLs to reflect repository rename to 'sos'.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Fix typo in PowerPC plugin

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