Collect network interfaces flags

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>
Use := with gmake shell function for better optimization

Also updated the REPO variable to point to new vcs location

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
Update travis-ci build status image

Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
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>