aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Correct archive unittests and pep8 conformity in archive classAdam Stokes2013-07-253-64/+69
| | | | Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Fix add_copy_specs(string) bugs in openstack.pyBryn M. Reeves2013-07-251-7/+9
| | | | | | | | | | | OpenStack was full of the add_copy_specs(string) anti-pattern. While we should address this properly these instances all need fixing to avoid collecting the whole file system. They should also have been tested before being put forward as a pull request. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Delete bogus dist checks from RedHatOpenStackBryn M. Reeves2013-07-251-5/+0
| | | | | | | | We already know we are running on RHEL or Fedora if we are executing a plug-in class tagged with RedHatPlugin. Do not check for /etc/*-release. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix broken binary checks in openstack.pyBryn M. Reeves2013-07-251-33/+30
| | | | | | | | | | | | | | | | | The OpenStack plug-in attempts to check for the presence of binaries before running them. To do this it passes a relative path to os.path.exists(); clearly this will never succeed. Ideally plug-ins should never need to do these checks. If the binary exists we'll run it and if not we won't (with no harmful side-effects). This is how sos is currently designed and if there is a need for plug-ins to ever do this we should add a method to the base plug-in class e.g. Plugin.find_command() to do this properly (i.e. evaluating the policy-supplied PATH). For now, just make all of this unconditional. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Fix API usage in openstack plug-inBryn M. Reeves2013-07-251-1/+1
| | | | | | | | One call in openstack.py used the old addCopySpecs() method. This will fail with current sos-3.x code. Update it to use the new add_copy_specs() method instead. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Merge pull request #168 from jnpkrn/patch-luciBryn M. Reeves2013-07-251-2/+5
|\ | | | | cluster plugin: restrictions wrt. luci
| * cluster plugin: restrict data collected for luciJan Pokorný2013-07-201-2/+3
| | | | | | | | | | | | | | Notably, avoid server cert being added. On the other hand, allow collection of rotated log files for luci. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
| * cluster plugin: add obfuscation of luci secretsJan Pokorný2013-07-181-0/+2
| | | | | | | | Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
* | Merge pull request #167 from ivoks/jujuBryn M. Reeves2013-07-252-76/+72
|\ \ | | | | | | Refactored OpenStack plugin
| * | Rearrange openstack plugin so that distribution OpenStack classAnte Karamatic2013-07-081-76/+69
| | | | | | | | | | | | | | | | | | | | | contains all non-distribution specific details. Also dropped all logrotate parts since those are collected by logrotate plugin. Signed-off-by: Ante Karamatic <ante.karamatic@canonical.com>
| * | Add juju status and get-constraints outputsAnte Karamatic2013-07-081-0/+3
| |/ | | | | | | Signed-off-by: Ante Karamatic <ante.karamatic@canonical.com>
* | Added XFS pluginPierguido Lambri2013-07-251-0/+40
| | | | | | | | Signed-off-by: Pierguido Lambri <plambri@redhat.com>
* | Add Openshift plug-inBryn M. Reeves2013-07-091-0/+72
|/ | | | | | | | | | Add an sos plug-in for openshift to gathers several directories and command output sepcific to Openshift systems. Passwords and secrets are scrubbed for privacy reasons. Signed-off-by: Nick Harvey <niharvey at redhat dot com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Merge pull request #159 from battlemidget/patch-include-tempfile-moduleBryn M. Reeves2013-06-191-0/+1
|\ | | | | import tempfile into policies
| * import tempfile into policiesAdam Stokes2013-06-101-0/+1
| | | | | | | | Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* | Merge pull request #157 from battlemidget/patch-deb-updationBryn M. Reeves2013-06-192-3/+3
|\ \ | | | | | | Make debian packaging 'non-native'
| * \ Merge branch 'master' into patch-deb-updationAdam Stokes2013-06-1013-201/+544
| |\ \
| * | | update diffAdam Stokes2013-06-102-3/+3
| | | | | | | | | | | | | | | | Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* | | | New optional data collection for SELinux plug-inBryn M. Reeves2013-06-181-3/+10
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SELinux plug-in can now optionally collect object lists from the semanage command. Since this command loads the SELinux python run time (~4s/command) it can add considerably to the overall run time of sosreport - for this reason these commands are disabled by default and may be enabled via the selinux.list option: # sosreport -k selinux.list With the option turned on we also collect: semanage fcontext -l semanage login -l semanage port -l semanage user -l Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | | Fix policy classes for --tmp-dirBryn M. Reeves2013-06-102-0/+2
| | | | | | | | | | | | | | | | | | | | | Policy classes need to return the user-supplied temporary directory if they decide not to override it. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | | Reduce level of 'could not run' messages info->debugBryn M. Reeves2013-06-101-1/+1
| |/ |/| | | | | | | | | | | We expect not to find all commands; don't output a log message on each missing binary. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Bump versionr3.03.0Bryn M. Reeves2013-06-101-1/+1
| | | | | | | | Increment the spec file version to 3.0
* | Spec file updatesBryn M. Reeves2013-06-101-27/+305
| |
* | Test for symlink existence before creationBryn M. Reeves2013-06-101-1/+2
| | | | | | | | | | | | | | | | There are cases where we may attempt to add a symlink to the archive more than once. Since this will fail for paths that already exist test for their presence first. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Set umask when creating final archive fileBryn M. Reeves2013-06-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | The temporary trees used by sos are set up with correct permissions but tarfile.open() uses the default mode and umask settings. Set the umask to deny group and other permissions for the archive to avoid leaking data to unprivileged users. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Revert use of PAX archivesBryn M. Reeves2013-06-101-2/+1
| | | | | | | | | | | | | | | | | | | | Revert the use of POSIX PAX archive format in TarFileArchive. The code to capture SELinux file contexts is currently disabled in master due to the undesirable affects on archive extraction. Since this is the main reason for using the PAX format revert to automatic format selection to allow the widest compatibility. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Add get_cmd_dir() method to Plugin and make plug-ins use itBryn M. Reeves2013-06-106-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported in Issue #140 plug-ins that need to write to an arbitrary location in the archive are broken by the in-line tar archive changes. Introduce a 'get_tmp_dir()' method to the Archive classes that must return a writable directory that is included in the archive. Archives deriving from FileCacheArchive simply retun the root of the archive tree. Add a new method to Plugin to use this support, 'get_cmd_dir()', that will return 'Archive.get_tmp_dir() + 'sos_commands' + self.name()'. Fixes problems in lvm2, cloudforms, satellite and rhui. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Move tmp directory selection to policy classBryn M. Reeves2013-06-103-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Since some distributions may be using features like tmp-on-tmpfs that can cause problems for sos data collection move the selection of this directory into the policy class. The new behaviour respects options passed on the command line but will ignore any environment variables. Users wishing to override the location of sos' temporary files should use the command line option. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Add Archive.cleanup()Bryn M. Reeves2013-06-102-3/+11
| | | | | | | | | | | | | | | | Add a cleanup() method to the Archive classes and ensure that it is called during normal and abnormal termination (unless the pdb debugger has been invoked during --debug mode). Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Fix use of 'logsize' parameter in logs moduleBryn M. Reeves2013-06-101-1/+1
| | | | | | | | | | | | | | The logs module has a paramter 'logsize' but some code still uses the old 'syslogsize' name. Make all uses consistent. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Introduce new FileCacheArchive classBryn M. Reeves2013-06-102-148/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new level to the Archive class hierarchy. This class may be used by any archive class that needs to temporarily cache files in the file system during collection. Classes deriving from FileCacheArchive must supply _build_archive() and _compress() methods which will be called during archive finalization. This fixes the TarFileArchive problems caused by attempting to apply read-modify-write updates to content already present in the archive. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Move TempFileUtil initialisation to be after policy set upBryn M. Reeves2013-06-101-1/+1
| | | | | | | | | | | | | | | | Policies may wish to influence the choice of temporary directory. Move the TempFileUtil initialisation to be after the call to load policy. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Fix Plugin.add_copy_spec_limit() checksBryn M. Reeves2013-06-101-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | The logic in add_copy_spec_limit() only attempted to collect a 'tailed' version of a file that is over the size limit in the case that it is the first file in the list of specs. Change this to always collect the tailed version for the first file to exceed the size limit and improve the variable naming to be more consistent with related methods. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Fix make_path for absolute destination pathsBryn M. Reeves2013-06-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Pythons os.path.join behaviour returns only the last path given when that path is absolute. This means that when make_path() is given an absolute destination path (e.g. /etc/foo) it will return an archive path of '/etc/foo' causing an error when copying into the temporary tree. Check for absolute paths and use lstrip to remove leading instances of os.sep from the string. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Make SoSReport establish report directory structureBryn M. Reeves2013-06-072-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow clients of the Archive classes to create arbitrary directories. Sos needs to be able to do this to create the report directory structure within a temporary file system tree. This work also paves the way for improviyng the robustness of the tree copying code in Plugin (which presently relies on the Archive class to recurse up to root, adding parent directories that do not already exist in the archive to ensure the corret permissions and context are stored in the archive). This would also allow the Archive.add_parent() hack to be removed. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Tidy up archive initialisation codeBryn M. Reeves2013-06-071-4/+5
| | | | | | | | | | | | | | Improve code formatting and readability in _set_archive() ahead of new temporary tree archive code. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Fix superclass initialiser invocation in sanlockBryn M. Reeves2013-06-061-1/+1
| | | | | | | | | | | | | | The RedHatSANLock initialiser used the wrong class name when determining the parent class initialiser to invoke. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Fix typo in logs plug-inBryn M. Reeves2013-06-061-1/+1
| | | | | | | | | | | | s/)[/])/ Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* | Fix incorrect use of add_copy_specs() in system plug-inBryn M. Reeves2013-06-061-1/+1
|/ | | | | | | | | | | | | | | | The system plug-in tries to pass a naked string to add_copy_specs(). This causes each character of the string to be passed down to an invocation of add_copy_spec(): add_copy_specs(copyspecs=/proc/sys, sub=None) add_copy_spec(copyspec=/, sub=None) add_copy_spec(copyspec=p, sub=None) add_copy_spec(copyspec=r, sub=None) [...] Collecting '/' is clearly a bad idea (see Issue #141). Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Merge pull request #151 from BryanQuigley/patch-1Bryn M. Reeves2013-05-301-1/+1
|\ | | | | Update system.py, Typo
| * Update system.pyBryanQuigley2013-05-301-1/+1
|/ | | Typo, IPv6 not IPv8
* Merge pull request #149 from battlemidget/patch-debian-fixesBryn M. Reeves2013-05-176-41/+40
|\ | | | | Patch debian fixes
| * Fix typo in debian/policiesAdam Stokes2013-05-091-1/+1
| | | | | | | | Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
| * Fix latest debian packaging suggestions.Adam Stokes2013-05-095-40/+39
|/ | | | | | | | | | | | | | | | | | | | | | | | 1) lintian information, you should run lintian with '-IE --pedantic', lintian will tell you more if there are any problem. There are still some lintian information, but I don't care of them. you may fix them when you polish your package. 2) You use old format copyright files, it is better to switch to DEP5[1] compatible format. lintian shows this information. 3) The section is python, but I think admin should be better, after all, sosreport is a sysadmin tool 4) Please move LICENSE file to usr/share/doc/sosreport, rather than remove it. A note about 4. I have removed the actual installing of the LICENSE file in the Makefile in favor of the distribution specific packaging handle it. For example, within Debian everything is placed in debian/copyright which removes the need for our Makefile to do anything with the LICENSE file. Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
* Move syslog and rsyslog configuratoin collection to logs plug-inBryn M. Reeves2013-05-012-5/+6
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Move java data collection to separate plug-inBryn M. Reeves2013-05-012-4/+30
| | | | Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove syslog collection from general and add new logs plug-inBryn M. Reeves2013-05-012-42/+90
| | | | | | | | Move all the syslog collection from the general plug-in to a new logs plug-in and factor out the all_logs support from the RedHatLogs class into the Logs superclass. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Move dmesg collection from general to kernelBryn M. Reeves2013-04-302-6/+6
| | | | | | | | | | The kernel ring buffer is certainly more 'kernel' than 'general'. Put it where it belongs and remove the duplicate dmesg call and 'dmesg_now' suggested filename (there's no need as it's in a separate directory to the saved version at var/log/dmesg and the normal action of dmesg is to print the current content). Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Remove redundant data collection from hardware.pyBryn M. Reeves2013-04-301-37/+2
| | | | | | | | The hardware plug-in has been split up into separate ata, block, pci, scsi, and usb plug-ins remove the data collected for these subsystems from the hardware module. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
* Add new processor plug-inBryn M. Reeves2013-04-301-0/+47
| | | | | | | Add a new plug-in, processor, to capture CPU related information and separate out all the CPU data from the old hardware plug-in. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>