| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Loading the policy class accounts for most of the time sos spends
before outputing any UI text. Handle Ctrl-C during this period and
exit gracefully.
Fixes Issue #270.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Write operations raise IOError instead of OSError and do not
expose a filename attribute.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Out-of-space and read-only file system errors while creating the
compressed archive should be treated as fatal and cause the run
to end.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Out-of-space and read-only file system errors from plugins
should be treated as fatal and cause the run to end.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
Out-of-space and read-only file system errors while writing the
XML, plain-text, or HTML reports should be treated as fatal and
cause the run to end.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Out-of-space and read-only file system errors from plugins
should be treated as fatal and cause the run to end.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Allow the main SoSReport class to handle exceptions that occur
while calling a plugin's setup() and collect() methods.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Out-of-space and read-only file system errors from plugins
should be treated as fatal and cause the run to end.
Partial fix for Issue #266.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
Check for ENOSPC and EROFS when setting up the archive directory
structure and exit with failure and an error message.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Currently unexpected exceptions during archive setup log a python
backtrace and exit with success. Exit with failure (1) when this
happens and log a message indicating the exception is unhandled
before printing the backtrace.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The addition of 'runat' exposed a bug in the parameter passing for
commands. We pack a tuple into a list in add_cmd_output() and then
unpack it in collect_cmd_output(). These functions need to be
careful in the use of positional vs. keyword arguments; passing
keywords as though they were positional can lead to e.g. an
integer timeout value appearing in the tuple member for
'suggest_filename' causing an exception when we attempt to pass
the value to get_cmd_output_now().
Fix this by ensuring that all keyword args are passed explicitly
through these functions and improve the debug logging by printing
the tuple we are packing/unpacking.
This also removes the exception handling block from the function
collect_cmd_output() - this routine should allow exceptions to
propagate up so that they can be handled by the --debug logic.
The 'command not found' case is already logged in the generic
get_command_output() wrapper.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
When reading and writing files within the archive class use the
codecs module and set the 'utf-8' encoding. This prevents encoding
exceptions if a plugin passes a unicode string to add_string() or
if a plugin attempts to read unicode encoded data from an archive
file via the open_file() method.
Fixes Issue #275.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
Make code formatting more consistent and readable by removing very
long lines and using consistent style for multi-line function
prototypes and calls. Also fix a couple of comment typos.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Isn't really necessary anymore since we have an automated build kick
off everytime a commit is made.
https://code.launchpad.net/~sosreport/+archive/ppa
Closes #234
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
|\
| |
| |
| |
| |
| |
| | |
Closes #272
Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The OPAL console log used to live under /sys/kernel/debug/powerpc so it
was collected as part of that glob. This patch adds the new location at
/sys/firmware/opal/msglog to the list of collected files.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
|
| |
| |
| |
| |
| |
| | |
Probably doesnt matter but for cleanliness sake.
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
| |
| |
| |
| | |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The dmraid command writes metadata dumps into the current working
directory. This is normally /tmp meaning that the files are
created outside the archive.
Use runat to change directory to the appropriate path in the
archive before running the command and add an option to control
metadata collection.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
| |
| |
| |
| |
| |
| |
| | |
Shell redirect syntax is no longer supported and will fail. Remove
its use from the OpenStack Nova plugin.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding a default setup() method to the base Plugin class allows
useful plugins to be written declaratively by setting the 'files'
and 'packages' members of the subclass, e.g.:
class FooPlugin(Plugin):
plugin_name = 'foo'
packages = ('foo',)
files = ('/etc/foo.conf',)
Creates a plugin class named 'foo' that will run whenever the
'foo' package is installed or the '/etc/foo.conf' file exists.
The method calls self.add_copy_specs() with the plugin's files
list.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previous patch was missing the hunks for plugins other than
usb:
modified: sos/plugins/general.py
modified: sos/plugins/logs.py
modified: sos/plugins/networking.py
modified: sos/plugins/qpid.py
modified: sos/plugins/s390.py
The automation used to convert to add_copy_specs() and
add_cmd_outputs() left a few missing and stray commas in file
and command lists, for e.g. causing two lsusb commands to be
concatenated:
Running 71/74: usb...
[plugin:usb] collecting path '/sys/bus/usb'
[plugin:usb] collecting output of 'lsusblsusb -v'
[plugin:usb] collecting output of 'lsusb -t'
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The automation used to convert to add_copy_specs() and
add_cmd_outputs() left a few missing and stray commas in file
and command lists, for e.g. causing two lsusb commands to be
concatenated:
Running 71/74: usb...
[plugin:usb] collecting path '/sys/bus/usb'
[plugin:usb] collecting output of 'lsusblsusb -v'
[plugin:usb] collecting output of 'lsusb -t'
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
The plugin list shows logs twice for Ubuntu and Debian systems. Since the
variations between the 2 are minimal we are combining those classes.
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
|
|
|
|
|
|
|
| |
Plugins should not open-code calls to external commands. Use the
build-in check_ext_prog() interface instead and test for success
before attempting to collect the statedump files.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
Looks like python 3.4 is not ready available on travis-ci.org. We'll make
3.4 unit testing a requirement once travis-ci makes python 3.4 an available
environment.
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
|
|
|
| |
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
|
|\
| |
| | |
Add collection of /etc/network/interfaces.d for Ubuntu
|
|/
|
|
|
|
|
|
| |
Since 14.04 Trusty, ubuntu uses config scripts in
/etc/network/interfaces.d. Collect those.
Closes: #264
Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
|
|
|
|
|
|
|
|
|
|
| |
Add a new method to Plugin to add a list of commands to be run,
analogous to add_copy_specs() vs add_copy_spec().
Also convert a few plugins not using add_copy_specs() for long
file lists (or using it inconsistently).
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
| |
Fixes Issue #253.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
| |
The rpm plugin is the last user of shell syntax. For now have it
call its pipeline explicitly using sh -c '...'.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
OpenShift uses 'cd /path && cmd' in a call to add_cmd_output().
Replace this with the runat paramter and avoid shell syntax in
the plugin.
Related: Issue #253.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Add a new 'runat' parameter sos_get_command_output() to specify
a directory for the child to switch to before executing the given
command and propagate this through the various command output
collection interfaces.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This is redundant since the whole ps and mount output is
captured elsewhere. Also removes shell syntax from the plugin.
Related: Issue #253.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
| |
This is redundant since the whole lspci and lsmod output is
captured elsewhere. Also removes shell syntax from the plugin.
Related: Issue #253.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
This is redundant since the whole boottime dmesg (and current
dmesg buffer) are captured elsewhere. Also removes shell syntax
from the plugin.
Related: Issue #253.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
The generic UI text in the policy base class was replaced with
the Red Hat Enterprise Linux wording in commit c59877c. The
wording isn't suitable for all distributions so revert this part
of the commit and move the RHEL text back to the RHEL-specific
policy class.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve logging output and make consistent use of log levels in
plugin code.
Log messages for the archive and plugin classes now use their
own class-level logging interface to prefix messages with a
label indicating the message source, e.g.:
[plugin:yum] collecting output of 'yum -C repolist'
[archive:TarFileArchive] finalizing archive '/var/tmp/sosreport-f20-vm1-20140406162540'
Convert existing plugin and archive code to use the new
interfaces.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
| |
Since add_string() attempts to copystat() strings that exist in
the host file system it also needs to check for PermissionError
exceptions.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An exception can occur at several points in add_file()
- Copying the source to the destination
- Propagating permissions with shutil.copystat
- Setting ownership via os.chown
The second of these can occur when copying SELinux xattrs from
/proc. Separate out the three cases and ignore failures in
copystat.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
| |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
|
|
|
| |
Update URLs to reflect repository rename to 'sos'.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|