diff options
-rw-r--r-- | Makefile | 45 | ||||
-rw-r--r-- | doc/Makefile (renamed from docs/Makefile) | 0 | ||||
-rw-r--r-- | doc/conf.py (renamed from docs/conf.py) | 0 | ||||
-rw-r--r-- | doc/index.rst (renamed from docs/index.rst) | 0 | ||||
-rw-r--r-- | doc/make.bat (renamed from docs/make.bat) | 0 | ||||
-rwxr-xr-x | extras/sysreport/functions | 132 | ||||
-rwxr-xr-x | extras/sysreport/sysreport-fdisk | 8 | ||||
-rwxr-xr-x | extras/sysreport/sysreport.legacy | 766 | ||||
-rw-r--r-- | extras/sysreport/text.xsl | 33 | ||||
-rw-r--r-- | man/en/sosreport.1 (renamed from sosreport.1) | 0 | ||||
-rw-r--r-- | setup.py | 196 | ||||
-rw-r--r-- | sos.spec | 26 | ||||
-rw-r--r-- | sos/__init__.py | 26 | ||||
-rw-r--r-- | sos/plugins/general.py | 3 | ||||
-rw-r--r-- | sos/plugintools.py | 1 | ||||
-rwxr-xr-x | sos/sosreport.py | 6 | ||||
-rw-r--r-- | tests/__init__.py (renamed from test/__init__.py) | 0 | ||||
-rw-r--r-- | tests/commons.py (renamed from test/commons.py) | 0 | ||||
-rw-r--r-- | tests/fixture/__init__.py (renamed from test/fixture/__init__.py) | 0 | ||||
-rw-r--r-- | tests/fixture/dummyPluginDisabled.py (renamed from test/fixture/dummyPluginDisabled.py) | 0 | ||||
-rw-r--r-- | tests/fixture/dummyPluginEnabled.py (renamed from test/fixture/dummyPluginEnabled.py) | 0 | ||||
-rw-r--r-- | tests/testbasic.py (renamed from test/testbasic.py) | 0 | ||||
-rw-r--r-- | tests/testldap.py (renamed from test/testldap.py) | 0 |
23 files changed, 199 insertions, 1043 deletions
@@ -15,16 +15,14 @@ TOPDIR = $(HOME)/rpmbuild/SOURCES TMPDIR = /tmp/$(NAME)-$(VERSION) MANPAGE = $(PWD)/sosreport.1 SOURCE1 = $(PWD)/sos.conf -SOURCE2 = $(PWD)/sosreport.1.gz SOURCE3 = $(PWD)/gpgkeys/rhsupport.pub all: .PHONY: tarball install clean rpm -tarball: clean mo gpgkey +tarball: clean gpgkey @echo "Build Archive" - @test -f $(SOURCE2) || gzip -c $(MANPAGE) > $(SOURCE2) @mkdir $(TMPDIR) @python setup.py sdist -d $(TMPDIR) @mkdir $(PWD)/dist @@ -32,62 +30,21 @@ tarball: clean mo gpgkey @echo " " @echo "The final archive is $(PWD)/dist/" -install:gpgkey mo - python setup.py install - @rm -rf build/lib - clean: @rm -fv *~ .*~ changenew ChangeLog.old $(NAME)-$(VERSION).tar.gz @rm -rfv {dist,build,sos.egg-info} @rm -rf MANIFEST @rm -rfv $(TMPDIR) - @rm -rf {$(SOURCE2),$(SOURCE3)} - @for i in `ls po`; do \ - if [ -d po/$$i ]; then \ - rm -rf po/$$i; \ - fi; \ - done; @for i in `find . -iname *.pyc`; do \ rm $$i; \ done; \ -# TODO: This needs work -internal-rpm: gpgkey - @test -f sos-internal.spec - @mkdir -p $(TOPDIR)/SOURCES $(TOPDIR)/SRPMS $(TOPDIR)/RPMS $(TOPDIR)/BUILD $(SRCDIR)/dist - cp gpgkeys/rhsupport.pub gpgkeys/rhsupport.key $(TOPDIR)/SOURCES - -# this builds an RPM from the current working copy - @cd $(TOPDIR)/BUILD ; \ - rm -rf $(NAME)-$(VERSION) ; \ - ln -s $(SRCDIR) $(NAME)-$(VERSION) ; \ - tar --gzip --exclude=.svn --exclude=svn-commit.tmp --exclude=$(NAME)-$(VERSION)/build --exclude=$(NAME)-$(VERSION)/dist \ - --exclude gpgkeys/rhsupport.pub --exclude gpgkeys/rhsupport.key \ - -chSpf $(TOPDIR)/SOURCES/$(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION) ; \ - rm -f $(NAME)-$(VERSION) - - rpmbuild -ba --define="_topdir $(TOPDIR)" sos-internal.spec - @mv $(TOPDIR)/RPMS/noarch/$(NAME)-internal-*.rpm $(TOPDIR)/SRPMS/$(NAME)-internal-*.rpm dist/ - cp gpgkeys/rhsupport.key dist/ - rpm: @test -d $(TOPDIR) || mkdir -p $(TOPDIR) @mv dist/* $(TOPDIR) @test -f sos.spec rpmbuild -ba sos.spec -pot: - xgettext -o po/sos.pot sos/sosreport.py sos/policyredhat.py - -mo: - @echo "Generating mo files" - @for i in `ls po`; do \ - if [ $$i != 'sos.pot' ]; then \ - mkdir po/$${i%.po}; \ - python tools/msgfmt.py -o po/$${i%.po}/sos.mo po/$$i; \ - fi; \ - done; \ - gpgkey: @echo "Building gpg key" @test -f gpgkeys/rhsupport.pub && echo "GPG key already exists." || \ diff --git a/docs/Makefile b/doc/Makefile index 181ab3ef..181ab3ef 100644 --- a/docs/Makefile +++ b/doc/Makefile diff --git a/docs/conf.py b/doc/conf.py index e7e1c162..e7e1c162 100644 --- a/docs/conf.py +++ b/doc/conf.py diff --git a/docs/index.rst b/doc/index.rst index cb2cbe67..cb2cbe67 100644 --- a/docs/index.rst +++ b/doc/index.rst diff --git a/docs/make.bat b/doc/make.bat index 104ca9b0..104ca9b0 100644 --- a/docs/make.bat +++ b/doc/make.bat diff --git a/extras/sysreport/functions b/extras/sysreport/functions deleted file mode 100755 index fff52ccd..00000000 --- a/extras/sysreport/functions +++ /dev/null @@ -1,132 +0,0 @@ -#! /bin/sh -export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin" -export LANG=C -export LC_ALL=C -export LC_CTYPE=C - -log="sysreport.log" - -fixupfile() { - if [ -f $2 ] ; then - /bin/sed -e$1 $2 > $2.newfile - /bin/mv $2.newfile $2 - fi - return 0 -} - -getpartinfo() { - # Get fdisk -l output from all disks/partitionable raid devices from /proc/partitions - raiddevs=`/bin/cat /proc/partitions | /bin/egrep -v "^major|^$" | /bin/awk '{print $4}' | /bin/grep \/ | /bin/egrep -v "p[0123456789]$"` - disks=`/bin/cat /proc/partitions | /bin/egrep -v "^major|^$" | /bin/awk '{print $4}' | /bin/grep -v / | /bin/egrep -v "[0123456789]$"` - echo "fdisk -l output" - for d in $raiddevs $disks ; do - echo "<---- Disk: /dev/${d} ---->" - echo "" - /sbin/fdisk -l /dev/${d} 2>&1 - echo "" - echo "<---- END ---->" - done -} - -getpciinfo() { -( echo "lspci" - echo - /sbin/lspci - echo - echo "lspci -n" - echo - /sbin/lspci -n - echo - echo "lspci -nv" - echo - /sbin/lspci -nv - echo - echo "lspci -nvv" - echo - /sbin/lspci -nvv ) 2>&1 -} - -catiffile() { - if [ -d $1 ]; then - /bin/cp -p -x --parents -R $1 $ROOT 2>>$ROOT/$log - find $ROOT/$1 -type b -o -type c | xargs rm -f 2>/dev/null || : - echo -n $STATUS - echo_success - return 1 - fi - if [ -f $1 ]; then - /bin/cp -p --parents $1 $ROOT 2>>$ROOT/$log - echo -n $STATUS - echo_success - return 1 - fi - - return 0 -} - -catifexec() { - if [ -x $1 ]; then - echo -n $STATUS - echo "$*" >> $ROOT/`/bin/basename $1` - $* >> $ROOT/`/bin/basename $1` 2>&1 - echo_success - return 1 - fi - return 0 -} - -# The following was borrowed from the Red Hat 6.x init scripts function -# to aid in letting the user know the application was still working. -# -# Get a sane screen width -[ -z "$COLUMNS" ] && COLUMNS=80 - -# Read in our configuration -if [ -z "$BOOTUP" ]; then - if [ -f /etc/sysconfig/init ]; then - . /etc/sysconfig/init - else - # This all seem confusing? Look in /etc/sysconfig/init, - # or in /usr/doc/initscripts-*/sysconfig.txt - BOOTUP=color - RES_COL=60 - MOVE_TO_COL="echo -en \\033[300C\\033[$[${COLUMNS}-${RES_COL}]D" - SETCOLOR_SUCCESS="echo -en \\033[1;32m" - SETCOLOR_FAILURE="echo -en \\033[1;31m" - SETCOLOR_WARNING="echo -en \\033[1;33m" - SETCOLOR_NORMAL="echo -en \\033[0;39m" - LOGLEVEL=1 - fi -fi - -echo_success() { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[ " - [ "$BOOTUP" = "color" ] && $SETCOLOR_SUCCESS - echo -n "OK" - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo " ]" - return 0 -} - -echo_failure() { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE - echo -n "FAILED" - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo "]" - return 1 -} - -echo_passed() { - [ "$BOOTUP" = "color" ] && $MOVE_TO_COL - echo -n "[" - [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING - echo -n "PASSED" - [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - echo "]" - return 1 -} - - diff --git a/extras/sysreport/sysreport-fdisk b/extras/sysreport/sysreport-fdisk deleted file mode 100755 index 451cb535..00000000 --- a/extras/sysreport/sysreport-fdisk +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/sh - -/sbin/fdisk -l /dev/hd[a-g] -/sbin/fdisk -l /dev/sd[a-p] -/sbin/fdisk -l /dev/md[0-9] /dev/md[1][0-5] -for i in `/bin/ls /dev/rd/ | /bin/grep -v p[0-9]`; do - /sbin/fdisk -l /dev/rd/"$i" 2>&1 -done diff --git a/extras/sysreport/sysreport.legacy b/extras/sysreport/sysreport.legacy deleted file mode 100755 index 043ba026..00000000 --- a/extras/sysreport/sysreport.legacy +++ /dev/null @@ -1,766 +0,0 @@ -#! /bin/bash -# -# System Report -# Copyright (c) 1999-2006 Red Hat, Inc. All rights reserved. -# -# Written by: -# Wil Harris <wil@redhat.com> -# Peter Jones <pjones@redhat.com> -# Preston Brown <pbrown@redhat.com> -# Than Ngo <than@redhat.com> - -umask 0077 -UTILDIR=/usr/share/sysreport -VER=`/bin/uname -r` -PATH="" -PROGNAME="sysreport" -DATE=`/bin/date -u +%G%m%d%k%M%S | /usr/bin/tr -d ' '` - -function usage { - echo "Sysreport is a utility that gathers information about a system's" - echo "hardware and configuration. The information can then be used for" - echo "diagnostic purposes and debugging. Sysreport is commonly used to help" - echo "support technicians and developers by providing a "snapshot" of a" - echo "system's current layout." - echo - echo "Usage: sysreport [OPTION]" - echo " -help : show help" - echo " -norpm : omit collecting information about currently installed packages" - echo " -dmidecode: enable dmidecode, getting information about the hardware" - echo " -firewall : collecting the system firewall rules" - echo " -home : place sysreport outputs within home directory" - echo " -usesysrq : collecting information about sysrq-trigger" - echo - exit 0 -} - -[ $# -lt 6 ] || usage -for i -do - case "$i" in - -help) usage;; - -norpm) NORPM=yes;; - -dmidecode) DMIDECODE=yes;; - -firewall) FIREWALL=yes;; - -home) HOMEDIR=yes;; - -sysrq) SYSRQ_TRIGGER=yes;; - -usesysrq) SYSRQ_TRIGGER=yes;; - *) usage;; - esac -done - -if [ -f $UTILDIR/functions ]; then - . $UTILDIR/functions -else - echo "Sysreport is not properly installed" - exit 1 -fi -if [ $UID != 0 ]; then - echo "You must be root to use this utility" - exit 1 -fi - -if [ "$HOMEDIR" = yes ] ; then - TEMPDIR=$HOME - ROOT=$HOME/sysreport-$DATE - /bin/mkdir $ROOT >& /dev/null -else - TEMPDIR=/tmp - ROOT=`/bin/mktemp -dq /tmp/sysreport.XXXXXXXX` -fi -if [ $? != 0 ] ; then - echo "Cannot make temp dir" - exit 1 -fi - -trap "{ rm -rf $ROOT ; exit ; }" EXIT - -if [ -f /etc/fedora-release ] ; then - release_name="Fedora Core" -else - release_name="Red Hat Linux" -fi - -echo -echo "This utility will go through and collect some detailed information " -echo "about the hardware and setup of your $release_name system." -echo "This information will be used to diagnose problems with your system" -echo "and will be considered confidential information. Red Hat will use" -echo "this information for diagnostic purposes ONLY. " -echo -echo "Please wait while we collect information about your system." -echo -echo "This process may take a while to complete...." -echo "No changes will be made to your system during this process." -echo -echo "NOTE: You can safely ignore a failed message. This only means a file" -echo "we were checking for did not exist." -echo -echo "If your system hangs while gathering rpm information, please abort" -echo "the script with CTRL-C and run it again after adding -norpm to the" -echo "sysreport command line" -echo -echo "Press ENTER to continue, or CTRL-C to quit." -read IGNORE - -echo -echo "Getting system configuration information." -echo -STATUS="Determining $release_name version:" -catiffile "/etc/redhat-release" - -STATUS="Determinding your current hostname: " -catifexec "/bin/hostname" - -STATUS="Getting the date:" -catifexec "/bin/date" - -STATUS="Checking your systems current uptime and load average:" -catifexec "/usr/bin/uptime" - -STATUS="Checking available memory:" -catifexec "/usr/bin/free" - -STATUS="Checking free disk space:" -catifexec "/bin/df" "-al" - -STATUS="Checking currently running processes:" -catifexec "/bin/ps" "-e -o euser,pid,ppid,tty,%cpu,%mem,rss,vsz,start_time,time,state,wchan,cmd" - -STATUS="Checking current process tree:" -catifexec "/usr/bin/pstree" - -STATUS="Collecting information about ld.so.conf:" -catiffile "/etc/ld.so.conf" - -STATUS="Collecting information about ld.so.conf.d:" -catiffile "/etc/ld.so.conf.d" - -STATUS="Collecting IPC-related information:" -catifexec "/usr/bin/ipcs" "-a" - -STATUS="Collecting information about chkconfig --list:" -catifexec "/sbin/chkconfig" "--list" - -STATUS="Collecting information about /etc/rc.d:" -catiffile "/etc/rc.d" -/bin/ls /etc/rc.d/rc*.d/ > $ROOT/etc/rc.d/ls-output - -if [ -x /usr/sbin/lsof ] ; then - STATUS="Lists information about files opened (lsof)" - catifexec "/usr/sbin/lsof" "-b +M -n -l" -fi - -STATUS="Collecting interprocess communication facilities status" -catifexec "/usr/bin/ipcs" "-u" -catifexec "/usr/bin/ipcs" "-l" - -# check to see if we want to run rpm, under some circumstances -# rpm can hang and never complete -# yes, command line parsing needs some work -if [ "$NORPM" != "yes" ]; then - echo "Collecting information about currently installed packages:" - echo -n "This may take several minutes...." - /bin/rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH}\n" > $ROOT/installed-rpms - /bin/rpm -Va > $ROOT/rpm-Va 2>&1 - echo_success -fi - -STATUS="Getting bootloader information:" -/bin/ls -alR /boot > $ROOT/ls-boot 2>&1 - -# This covers sparc, alpha, and intel (respectively) -# updated for grub -mpg -if [ -f /etc/silo.conf ]; then - STATUS="Collecting information about the boot process (silo):" - catiffile "/etc/silo.conf" -fi -if [ -f /etc/milo.conf ]; then - STATUS="Collecting information about the boot process (milo):" - catiffile "/etc/milo.conf" -fi -if [ -f /etc/lilo.conf ]; then - STATUS="Collecting information about the boot process (lilo):" - catiffile "/etc/lilo.conf" - catifexec "/sbin/lilo" "-q" -fi -if [ -d /boot/grub -a -f /boot/grub/grub.conf -a -f /boot/grub/device.map ]; then - STATUS="Collecting information about the boot process (grub.conf):" - catiffile "/boot/grub/grub.conf" - STATUS="Collecting information about the boot process (grub.map):" - catiffile "/boot/grub/device.map" -fi -if [ -f /etc/cluster.conf -o -f /etc/cluster.xml -o -f /etc/cluster/cluster.conf ] ; then - STATUS="Gathering information on cluster setup" - # 2.1 AS - if [ -f /etc/cluster.conf ] ; then - catiffile "/etc/cluster.conf" - fi - # Taroon - if [ -f /etc/cluster.xml ] ; then - catiffile "/etc/cluster.xml" - fi - # RHEL4 - if [ -d /etc/cluster ]; then - catiffile "/etc/cluster" - fi -fi -STATUS="Collecting init configuration:" -catiffile "/etc/inittab" - -STATUS="Collecting information about X:" -catiffile "/etc/X11" - -STATUS="Gathering sysctl information (/proc/sys):" -catifexec "/sbin/sysctl" "-a" -STATUS="Gathering sysctl information (/etc/sysctl.conf):" -catiffile "/etc/sysctl.conf" - -for x in `/bin/ls -d /etc/cron*` ; do - STATUS="Collecting information about cron ($(/bin/basename $x)):" - catiffile "$x" -done - -STATUS="Gathering Syslog config information:" -catiffile "/etc/syslog.conf" - -STATUS="Gathering ntp configuration (/etc/ntp.conf):" -catiffile "/etc/ntp.conf" -STATUS="Gathering ntp configuration (/etc/ntp/step-tickers):" -catiffile "/etc/ntp/step-tickers" -STATUS="Gathering ntp configuration (/etc/ntp/ntpservers):" -catiffile "/etc/ntp/ntpservers" - -STATUS="Gathering IP information (/sbin/ifconfig):" -catifexec "/sbin/ifconfig" "-a" - -STATUS="Checking network routes:" -catifexec "/sbin/route" "-n" - -STATUS="Collecting Name Service Switch config information:" -catiffile "/etc/nsswitch.conf" -STATUS="Collecting NIS client information:" -catiffile "/etc/yp.conf" - -STATUS="Collecting system configuration information:" -catiffile "/etc/sysconfig" -fixupfile 's/\(.*Password=\)\(.*\)/\1********/' $ROOT/etc/sysconfig/rhn/up2date - -STATUS="Collecting information about system authentication (pam):" -catiffile "/etc/pam.d" - -echo -echo "Getting information about the kernel." -echo -STATUS="Getting kernel version:" -catifexec "/bin/uname" "-a" -STATUS="Checking module information:" -catifexec "/sbin/lsmod" -for x in $(/sbin/lsmod | /bin/cut -f1 -d" " 2>/dev/null | /bin/grep -v Module 2>/dev/null ) ; do - STATUS="Checking module information $x:" - catifexec "/sbin/modinfo" "$x" -done - -STATUS="Currently getting ksysms information:" -catifexec "/sbin/ksyms" - -STATUS="Gathering information about your filesystems:" -catiffile "/proc/filesystems" - -STATUS="Gathering information about your system stat:" -catiffile "/proc/stat" - -STATUS="Gathering information about your partitions:" -catiffile "/proc/partitions" - -STATUS="Gathering information about your ksysms:" -catiffile "/proc/ksyms" - -STATUS="Gathering information about slabinfo:" -catiffile "/proc/slabinfo" - -# Added support to cover for the new modules.conf layout in Red Hat 7 -STATUS="Collecting information regarding kernel modules" -catiffile "/lib/modules/$VER/modules.dep" -if [ -f /etc/conf.modules ]; then - STATUS="Collecting information regarding kernel modules (conf.modules)" - catiffile "/etc/conf.modules" -fi -if [ -f /etc/modules.conf ]; then - STATUS="Collecting information regarding kernel modules (modules.conf)" - catiffile "/etc/modules.conf" -fi -if [ -f /etc/modprobe.conf ]; then - STATUS="Collecting information regarding kernel modules (modeprobe.conf)" - catiffile "/etc/modprobe.conf" -fi - -if [ "$DMIDECODE" == "yes" ] ; then - echo "Getting information about the hardware." - echo - if [ -x /usr/sbin/dmidecode ] ; then - STATUS="Gathering DMI information:" - catifexec "/usr/sbin/dmidecode" - fi -fi - -# dkms status -STATUS="Gathering current status of modules, versions and kernels (dkms):" -if [ -x /usr/sbin/dkms ] ; then - catifexec "/usr/sbin/dkms" "status" -fi - -if [ -f /etc/sysconfig/isdncard ] ; then - STATUS="Gathering information about ISDN:" - catiffile "/etc/sysconfig/isdncard" -fi - -STATUS="Collecting information from the proc directory:" -catiffile "/proc/pci" - -STATUS="Getting kernel command line" -catiffile "/proc/cmdline" - -STATUS="Gathering information about your CPU:" -catiffile "/proc/cpuinfo" - -STATUS="Gathering information about your Ram:" -catiffile "/proc/meminfo" - -STATUS="Gathering information about your ioports:" -catiffile "/proc/ioports" - -STATUS="Gathering information about your interrupts:" -catiffile "/proc/interrupts" - -STATUS="Gathering information about your scsi devices:" -catiffile "/proc/scsi" - -STATUS="Gathering information about your dma:" -catiffile "/proc/dma" - -STATUS="Gathering information about your devices (/proc/devices):" -catiffile "/proc/devices" - -STATUS="Gathering information about your rtc:" -catiffile "/proc/rtc" - -STATUS="Gathering information about your ide drivers:" -catiffile "/proc/ide" - -STATUS="Gathering information about your bus:" -getpciinfo > $ROOT/lspci -catiffile "/proc/bus" - -STATUS="Gathering info on udev configuration:" -catiffile "/etc/udev" - -echo -echo "Getting disk and filesystem information." -echo - -STATUS="Collecting information from /etc/fstab:" -catiffile "/etc/fstab" - -STATUS="Collecting disk partition information:" -PATH=/bin getpartinfo > $ROOT/fdisk-l - -STATUS="Checking mounted file systems (mount) " -catifexec "/bin/mount" - -STATUS="Checking mounted file systems (/proc/mounts)" -catiffile "/proc/mounts" - -STATUS="Collecting Software RAID information (/proc/mdstat)" -catiffile "/proc/mdstat" - -STATUS="Collecting Software RAID information (/etc/raidtab)" -catiffile "/etc/raidtab" - -STATUS="Collecting Software RAID information (/etc/mdadm.conf)" -catiffile "/etc/mdadm.conf" - -STATUS="Collecting Software RAID information (mdadm -D /dev/md*)" -catifexec "/sbin/mdadm" "-D /dev/md*" - -STATUS="Collecting Automount information (auto.master)" -catiffile "/etc/auto.master" - -STATUS="Collecting Automount information (auto.misc)" -catiffile "/etc/auto.misc" - -STATUS="Collecting Automount information (auto.net)" -catiffile "/etc/auto.net" - -STATUS="Collecting LVM information:" -catifexec "/usr/sbin/vgdisplay" "-vv" - -STATUS="Gathering LVM setup" -catiffile "/etc/lvm" - -STATUS="Collecting SCSI Tape information (/etc/stinit.def)" -catiffile "/etc/stinit.def" - -if [ -x /sbin/lsusb ] ; then - STATUS="Collecting USB devices list (lsusb):" - catifexec "/sbin/lsusb" -fi - -if [ -x /usr/bin/lshal ] ; then - STATUS="Collecting global devices list (lshal):" - catifexec "/usr/bin/lshal" -fi - -echo -echo "collecting information about commonly used network services" -echo -# This covers backwards compatiablity for systems with inetd while keeping -# support for the new 7.x xinetd -if [ -f /etc/inetd.conf ]; then - STATUS="Collecting information about system services (inetd.conf)" - catiffile "/etc/inetd.conf" -elif [ -f /etc/xinetd.conf ]; then - STATUS="Collecting information about system services (xinetd.conf)" - catiffile "/etc/xinetd.conf" - for x in `/bin/ls -d /etc/xinetd.d/*`; do - STATUS="Collecting information about system services ($(/bin/basename $x))" - catiffile "$x" - done -fi -for x in `/bin/ls -d /etc/host*` ; do - STATUS="Collecting information from $x:" - catiffile "$x" -done - -STATUS="Collecting information about the ftp servers:" -ftpconfigfiles=`/bin/ls -d /etc/ftp* /etc/vsftpd/* 2>/dev/null` -for x in $ftpconfigfiles; do - STATUS="Collecting information about the ftp servers ($(/bin/basename $x)):" - catiffile "$x" -done - -STATUS="Collecting information about ypbind configuration:" -catiffile "/etc/yp.conf" - -if [ "$FIREWALL" == "yes" ]; then - KERNELMIN=`/bin/uname -r | /bin/sed -e 's,[^\.]*\.,,' -e 's,\..*,,'` - ipchainsmod=`/sbin/lsmod 2>/dev/null| /bin/grep ipchains` - - if [ "$KERNELMIN" -lt 3 ] || [ -n "${ipchainsmod}" ] ; then - STATUS="Getting ipchains information:" - catifexec "/sbin/ipchains" "-nvL" - elif [ "$KERNELMIN" -gt 3 ]; then - STATUS="Getting iptables information:" - if [ -f /etc/sysconfig/iptables-config ] ; then - catiffile "/etc/sysconfig/iptables-config" - fi - STATUS="Getting iptables information (filter):" - catifexec "/sbin/iptables" "-t filter -nvL" - STATUS="Getting iptables information (mangle):" - catifexec "/sbin/iptables" "-t mangle -nvL" - STATUS="Getting iptables information (nat):" - catifexec "/sbin/iptables" "-t nat -nvL" - fi -fi - -# ldap client and server config -if [ -f /etc/ldap.conf ] ; then - STATUS="Getting LDAP configuration (ldap.conf)" - catiffile "/etc/ldap.conf" -fi -if [ -d /etc/openldap ] ; then - for x in `/bin/ls -d /etc/openldap/*` ; do - if [ -f $x ] ; then - STATUS="Getting LDAP configuration ($(/bin/basename $x))" - catiffile "$x" - fi - done -fi - -# ssh -STATUS="Getting ssh configuration (ssh_config)" -catiffile "/etc/ssh/ssh_config" -STATUS="Getting sshd configuration (sshd_config)" -catiffile "/etc/ssh/sshd_config" - -# sendmail -SENDMAIL_CF_FILE=/etc/mail/sendmail.cf -SENDMAIL_CW_FILE=/etc/mail/sendmail.cw - -if [ -f /etc/sendmail.cf ] ; then - SENDMAIL_CF_FILE=/etc/sendmail.cf -fi - -if [ -f /etc/sendmail.cw ] ; then - SENDMAIL_CW_FILE=/etc/sendmail.cw -fi - -STATUS="Sendmail Configuration ($SENDMAIL_CF_FILE):" -catiffile "$SENDMAIL_CF_FILE" -if [ -f $SENDMAIL_CW_FILE ]; then - STATUS="Sendmail Machine aliases ($SENDMAIL_CW_FILE):" - catiffile "$SENDMAIL_CW_FILE" -fi - -STATUS="Sendmail User aliases (/etc/aliases):" -catiffile "/etc/aliases" - -for f in `/bin/ls -d /etc/mail/* | /bin/grep -v \.db`; do - STATUS="Getting files from ($(/bin/basename $f))" - catiffile $f -done - -STATUS="Collecting Postfix Configuration (main.cf)" -catiffile "/etc/postfix/main.cf" - -STATUS="Collecting Postfix Configuration (master.cf)" -catiffile "/etc/postfix/master.cf" - -STATUS="Collecting exim configuration directory" -catiffile "/etc/exim" - -STATUS="Collecting host resolution information" -catiffile "/etc/resolv.conf" - -# Make sure we have support for both versions of bind -if [ -f /etc/named.boot ]; then - STATUS="Collecting information about the nameserver (named.boot)" - catiffile "/etc/named.boot" -elif [ -f /etc/named.conf ]; then - STATUS="Collecting information about the nameserver (named.conf)" - catiffile "/etc/named.conf" -fi - -DNSDIR="" -if [ -f /etc/named.conf ]; then - DNSDIR=$(/bin/grep -i directory /etc/named.conf |/bin/gawk '{ print $2 ;}'|\ - /bin/sed s/\"//g|/bin/sed s/\;//g) -elif [ -f /etc/named.boot ]; then - DNSDIR=$(/bin/grep -i directory /etc/named.boot|/bin/gawk '{ print $2 ;}') -fi - -if [ -n "$DNSDIR" -a -d "$DNSDIR" ]; then - STATUS="Collecting information about the nameserver ($DNSDIR)" - catiffile "$DNSDIR" -fi - -if [ -f /etc/exports ] ; then - STATUS="Collecting information about the NFS:" - catiffile "/etc/exports" -fi - -SAMBADIR="/etc/samba" -if [ -d $SAMBADIR ]; then - STATUS="Getting samba informations ($SAMBADIR)" - for x in `/bin/ls -d $SAMBADIR/* | grep -vE 'smbpasswd|secrets\.tdb|\.bak|\.rpmnew'` ; do - STATUS="Getting samba informations ($(/bin/basename $x))" - catiffile "$x" - done - /bin/ls -alR $SAMBADIR > $ROOT/ls-samba 2>&1 - if [ -x /usr/bin/wbinfo ] ; then - STATUS="Getting samba informations (wbinfo -g):" - catifexec "/usr/bin/wbinfo" "-g" - STATUS="Getting samba informations (wbinfo -u):" - catifexec "/usr/bin/wbinfo" "-u" - fi -fi - -STATUS="Getting /etc/securetty" -catiffile "/etc/securetty" - -STATUS="Getting /etc/shells" -catiffile "/etc/shells" - -STATUS="Getting ulimit info" -catiffile "/etc/security/limits.conf" - -STATUS="Getting nscd configuration" -catiffile "/etc/nscd.conf" - -STATUS="Getting Kerberos informations (/etc/krb5.conf)" -catiffile "/etc/krb5.conf" - -STATUS="Getting Kerberos informations (/etc/krb.conf)" -catiffile "/etc/krb.conf" - -STATUS="Getting Kerberos informations (/etc/krb.realms)" -catiffile "/etc/krb.realms" - -STATUS="Getting information about apache" -catiffile "/etc/httpd/conf/httpd.conf" - -for x in `/bin/ls -d /etc/httpd/conf.d/*.conf 2>/dev/null` ; do - STATUS="Getting information about apache ($(/bin/basename $x))" - catiffile "$x" -done - -STATUS="Getting information about squid" -catiffile "/etc/squid/squid.conf" - -STATUS="Getting information about CUPS" -for x in `/bin/ls -d /etc/cups/*.conf 2>/dev/null` ; do - STATUS="Getting information about CUPS ($x)" - catiffile "$x" -done - -echo -echo "Gathering information from system logs" -echo -STATUS="Collecting information from dmesg:" -catiffile "/var/log/dmesg" - -if [ "$SYSRQ_TRIGGER" == "yes" ]; then - STATUS="Collecting information from /proc/sysrq-trigger" - if [ -f /proc/sysrq-trigger -a -f /proc/sys/kernel/sysrq ] ; then - sysr_state="$(/bin/cat /proc/sys/kernel/sysrq)" - echo 1 > /proc/sys/kernel/sysrq - for key in m p t ; do - echo $key > /proc/sysrq-trigger - done - echo $sysr_state > /proc/sys/kernel/sysrq - fi -fi - -for x in `/bin/ls /var/log/messages*` ; do - STATUS="Collecting messages files ($x)" - catiffile "$x" -done -for x in `/bin/ls /var/log/maillog*` ; do - STATUS="Collecting maillog files ($x)" - catiffile "$x" -done - - -STATUS="Collecting information (/var/log/sa)" -catiffile "/var/log/sa" - -for x in `/bin/ls -d /var/log/Xorg.*.log /var/log/XFree86.*.log 2>/dev/null` ; do - STATUS="Collecting X logs ($x)" - catiffile "$x" -done - -STATUS="Collecting information (/var/log/rpmpkgs)" -catiffile "/var/log/rpmpkgs" - -STATUS="Collecting information (/var/log/boot.log)" -catiffile "/var/log/boot.log" - -STATUS="Collecting information (/var/log/up2date)" -catiffile "/var/log/up2date" - -STATUS="Collecting information (/var/log/secure)" -catiffile "/var/log/secure" - -STATUS="Collecting log files from Apache" -catiffile "/var/log/httpd" - -STATUS="Collecting log files from RHN" -if `/bin/ls /var/log/rhn* >& /dev/null` ; then - catiffile "/var/log/rhn*" -fi - -# General monitoring moc logs -if [ -d /opt/notification ] ; then - for x in `/bin/ls -d /opt/notification/var/*.log* 2>/dev/null` ; do - STATUS="Collecting monitoring moc logs ($(/bin/basename $x))" - catiffile "$x" - done - for x in `/bin/ls -d /var/tmp/ack_handler.log* 2>/dev/null` ; do - STATUS="Collecting monitoring moc logs ($(/bin/basename $x))" - catiffile "$x" - done - for x in `/bin/ls -d /var/tmp/enqueue.log* 2>/dev/null` ; do - STATUS="Collecting monitoring moc logs ($(/bin/basename $x))" - catiffile "$x" - done -fi - -# monitoring scout logs -if [ -d /home/nocpulse/var ] ; then - for x in `/bin/ls -d /home/nocpulse/var/*.log* 2>/dev/null` ; do - STATUS="Collecting monitoring scout logs ($(/bin/basename $x))" - catiffile "$x" - done - for x in `/bin/ls -d /home/nocpulse/var/commands/*.log* 2>/dev/null` ; do - STATUS="Collecting monitoring scout logs ($(/bin/basename $x))" - catiffile "$x" - done -fi - -/bin/echo -/bin/echo "Getting information about RHN" -/bin/echo -RHNDIR=/etc/sysconfig/rhn -/bin/mkdir -p $ROOT/$RHNDIR 2>/dev/null -catiffile "/etc/rhn" -if [ -f $RHNDIR/systemid ] ; then - echo -n "Gathering systemid information:" - if [ -x /usr/bin/xsltproc ] ; then - /usr/bin/xsltproc $UTILDIR/text.xsl $RHNDIR/systemid > $ROOT/$RHNDIR/systemid 2>/dev/null - echo_success - else - catiffile "$RHNDIR/systemid" - fi -fi - -# Get hardware profile information (for verification with system state and RHN) -if [ -x /usr/share/rhn/up2date_client/hardware.py ] ; then - STATUS="Gathering RHN hardware profile information" - catifexec /usr/share/rhn/up2date_client/hardware.py -fi -if [ -x /usr/bin/rhn-schema-version ] ; then - STATUS="Gathering schema version" - catifexec "/usr/bin/rhn-schema-version" -fi -if [ -x /usr/bin/rhn-charsets ] ; then - STATUS="Gathering database charactersets" - catifexec "/usr/bin/rhn-charsets" -fi - -# Get SELinux information -echo -echo "Gathering information on SELinux setup" -echo -catifexec "/usr/bin/selinuxconfig" -catifexec "/usr/sbin/sestatus" -catifexec "rpm" "-q -V selinux-policy-targeted" -catifexec "rpm" "-q -V selinux-policy-strict" - -cd $TEMPDIR -/bin/echo -/bin/echo -n "Please enter your case number (if you have one): " - -while read CASENUM -do - case $CASENUM in - *[^0-9]*) - /bin/echo -e "\nError: Your input contains non-numeric characters!" - /bin/echo -e "Please enter your case number (if you have one): " - ;; - *) - break ;; - esac -done -if [ ! $CASENUM ]; then - NAME=$PROGNAME-$HOSTNAME.$DATE -else - NAME="$PROGNAME-$HOSTNAME-$CASENUM.$DATE" -fi -/bin/rm -Rf $NAME -/bin/mv $ROOT $NAME -/bin/tar Scf $NAME.tar $NAME -if [ -x /usr/bin/bzip2 ]; then - /usr/bin/bzip2 $NAME.tar - SUFFIX="tar.bz2" -else - /bin/gzip -9 $NAME.tar - SUFFIX="tar.gz" -fi - -/bin/rm -Rf $NAME -/bin/echo -/bin/echo "Please send $TEMPDIR/${NAME}.${SUFFIX} to your support" -/bin/echo "representative." -/bin/echo - -exit 0 diff --git a/extras/sysreport/text.xsl b/extras/sysreport/text.xsl deleted file mode 100644 index c381b3a8..00000000 --- a/extras/sysreport/text.xsl +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version='1.0'?> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - version='1.0'> - -<xsl:output method="text" indent="no"/> - -<xsl:template match="array"> - <xsl:text>[</xsl:text> - <xsl:for-each select="data/value"> - <xsl:apply-templates/> - <xsl:if test="following-sibling::value"> - <xsl:text>, </xsl:text> - </xsl:if> - </xsl:for-each> - <xsl:text>] </xsl:text> -</xsl:template> - -<xsl:template match="string"> - <xsl:value-of select="."/> -</xsl:template> - -<xsl:template match="member"> - <xsl:value-of select="name"/> - <xsl:text>: </xsl:text> - <xsl:apply-templates select="value"/> - <xsl:text> </xsl:text> -</xsl:template> - -<xsl:template match="/"> - <xsl:apply-templates select=".//member"/> -</xsl:template> - -</xsl:stylesheet> diff --git a/sosreport.1 b/man/en/sosreport.1 index 394b0f97..394b0f97 100644 --- a/sosreport.1 +++ b/man/en/sosreport.1 @@ -1,64 +1,172 @@ #!/usr/bin/python """ -setup.py - Setup package with the help from Python's DistUtils +setup.py - Setup package with the help from Python's DistUtils and friends. """ +from distutils.core import setup, Command +from distutils.command.sdist import sdist as _sdist +from distutils.command.build import build as _build +from distutils.command.install_data import install_data as _install_data +from distutils.command.install_lib import install_lib as _install_lib +from distutils.command.install import install as _install +from unittest import TextTestRunner, TestLoader +from glob import glob +from os.path import splitext, basename, join as pjoin +import os, sys -try: - from setuptools import setup, find_packages -except ImportError: - from ez_setup import use_setuptools - from setuptools import setup, find_packages - -import glob -import os +locale = None +builddir = None data_files = [ ('/etc', [ 'sos.conf']), - ('/usr/sbin', ['sosreport', 'extras/sysreport/sysreport.legacy']), - ('/usr/bin', ['extras/rh-upload']), - ('/usr/share/sos/',['gpgkeys/rhsupport.pub']), - ('/usr/share/sysreport', ['extras/sysreport/text.xsl', 'extras/sysreport/functions', 'extras/sysreport/sysreport-fdisk']), - ('/usr/share/man/man1', ['sosreport.1.gz']), - ] - -lang_files = glob.glob('po/*/sos.mo') -for i18n in lang_files: - topdir, basedir, fname = i18n.split('/') - data_files.append(('/usr/share/locale/%s/LC_MESSAGES' % (basedir,) , [i18n])) - -test_sub_dirs = [] -def test_files_add(dir='test',test_dir='/usr/share/sos'): - """ test file dir addition """ - test_sub_dirs.append(dir) - for root, dirs, fname in os.walk(dir): - if '.svn' in dirs: - dirs.remove('.svn') - for name in dirs: - test_sub_dirs.append(os.path.join(dir,name)) - for dr in test_sub_dirs: - files = os.listdir(dr) + ('share/sos/', ['gpgkeys/rhsupport.pub']), + ('share/man/man1', ['sosreport.1'])] + + +class refresh_translations(Command): + user_options = [] + description = "Regenerate POT file and merge with current translations." + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + # generate POT file + files = [ "sos/*.py" ] + pot_cmd = "xgettext --language=Python -o po/sos.pot" for f in files: - if os.path.isfile(os.path.join(dr,f)): - data_files.append((os.path.join(test_dir,dr),[os.path.join(dr,f)])) + pot_cmd += " %s " % f + os.system(pot_cmd) + + # merge new template with existing translations + for po in glob.glob(os.path.pjoin(os.getcwd(), 'po', '*.po')): + os.system("msgmerge -U po/%s po/sos.pot" % + os.path.basename(po)) + +class sdist(_sdist): + """ updates man pages """ + def run(self): + self._update_manpages() + _sdist.run(self) + + def _update_manpages(self): + if os.system("make -C man/en"): + raise RuntimeError("Couldn't generate man pages.") + +class build(_build): + """ compile i18n files """ + def run(self): + global builddir + if not os.path.exists("build/po"): + os.makedirs("build/po") + + for filename in glob(pjoin(os.getcwd(), 'po', '*.po')): + filename = os.path.basename(filename) + lang = os.path.basename(filename)[0:len(filename)-3] + if not os.path.exists("build/po/%s" % lang): + os.makedirs("build/po/%s" % lang) + newname = "build/po/%s/sos.mo" % lang + + print "Building %s from %s" % (newname, filename) + os.system("msgfmt po/%s -o %s" % (filename, newname)) + + _build.run(self) + builddir = self.build_lib + +class install(_install): + """ extract install base for locale install """ + def finalize_options(self): + global locale + _install.finalize_options(self) + locale = self.install_base + "/share/locale" + +class install_lib(_install_lib): + """ custom install_lib command to place locale/docs location into library""" + + def run(self): + for initfile in [ "sos/__init__.py" ]: + cmd = "cat %s | " % initfile + cmd += """sed -e "s,::LOCALEDIR::,%s," > """ % locale + cmd += "%s/%s" % (builddir, initfile) + os.system(cmd) + + _install_lib.run(self) + +class install_data(_install_data): + """ custom install_data command to prepare i18n/docs files for install""" + def run(self): + dirlist = os.listdir("build/po") + for lang in dirlist: + if lang != "." and lang != "..": + install_path = "share/locale/%s/LC_MESSAGES/" % lang + src_path = "build/po/%s/sos.mo" % lang + print "Installing %s to %s" % (src_path, install_path) + toadd = (install_path, [src_path]) + # Add these to the datafiles list + datafiles.append(toadd) + +class TestBaseCommand(Command): + user_options = [] + + def initialize_options(self): + self.debug = 0 + self._testfiles = [] + self._dir = os.getcwd() + + def finalize_options(self): + pass + + def run(self): + tests = TestLoader().loadTestsFromNames(self._testfiles) + t = TextTestRunner(verbosity = 1) + + result = t.run(tests) + if len(result.failures) > 0 or len(result.errors) > 0: + sys.exit(1) + else: + sys.exit(0) + +class TestSOS(TestBaseCommand): + description = "Runs unittest" + user_options = TestBaseCommand.user_options + \ + [("testfile=", None, "Specify test to run"),] + + def initialize_options(self): + TestBaseCommand.initialize_options(self) + test.testfile = None + def finalize_options(self): + TestBaseCommand.finalize_options(self) -test_files_add() + def run(self): + """ find all tests """ + testfiles = [] + for t in glob(pjoin(self._dir, 'tests', '*.py')): + if self.testfile: + base = os.path.basename(t) + check = os.path.basename(self.testfile) + if base != check and base != (check + ".py"): + continue + testfiles.append('.'.join(['tests',splitext(basename(t))[0]])) -test_requirements = ['nose >= 0.10'] + self._testfiles = testfiles + TestBaseCommand.run(self) setup( name = 'sos', version = '1.9', author = 'Adam Stokes', - author_email = 'ajs@redhat.com', + author_email = 'astokes@fedoraproject.org', url = 'http://fedorahosted.org/sos', description = 'SOS - son of sysreport', - packages = find_packages(exclude=['test*']), - include_package_data = True, + packages = ['sos'], data_files = data_files, - test_suite = "test", - tests_require = test_requirements, - extras_require = { - 'docs' : ['sphinx >= 0.5'], - }, + cmdclass = { + 'test': TestSOS, + 'sdist': sdist, 'build' : build, + 'install_data' : install_data, + 'install_lib' : install_lib, + 'install' : install, + 'refresh_translations' : refresh_translations} ) @@ -3,16 +3,20 @@ Summary: A set of tools to gather troubleshooting information from a system Name: sos Version: 1.9 -Release: 2%{?dist} +Release: 2%{?dist}.1 Group: Applications/System Source0: https://fedorahosted.org/releases/s/o/sos/%{name}-%{version}.tar.gz License: GPLv2+ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot BuildArch: noarch Url: http://fedorahosted.org/sos -BuildRequires: python-devel, python-setuptools +BuildRequires: python-devel +BuildRequires: python-setuptools +BuildRequires: gettext Requires: libxml2-python -Requires: tar, bzip2, xz +Requires: tar +Requires: bzip2 +Requires: xz Provides: sysreport = 1.4.3-13 Obsoletes: sysreport @@ -31,10 +35,8 @@ support technicians and developers. %install rm -rf ${RPM_BUILD_ROOT} install -D -m644 gpgkeys/rhsupport.pub ${RPM_BUILD_ROOT}/%{_datadir}/%{name}/rhsupport.pub -install -D -m644 extras/sysreport/sysreport.legacy ${RPM_BUILD_ROOT}/%{_datadir}/%{name}/sysreport -%{__python} setup.py install -O1 --skip-build --root ${RPM_BUILD_ROOT} -ln -s /usr/sbin/sosreport ${RPM_BUILD_ROOT}/usr/sbin/sysreport -%find_lang %{name} +%{__python} setup.py install -O1 --root=${RPM_BUILD_ROOT} +%find_lang %{name} || echo 0 %clean rm -rf ${RPM_BUILD_ROOT} @@ -43,16 +45,16 @@ rm -rf ${RPM_BUILD_ROOT} %defattr(-,root,root,-) %{_bindir}/rh-upload %{_sbindir}/sosreport -%{_sbindir}/sysreport -%{_sbindir}/sysreport.legacy %{_datadir}/%{name} -%{_datadir}/sysreport %{python_sitelib}/* -%{_mandir}/man1/sosreport.1.gz -%doc README README.rh-upload TODO LICENSE ChangeLog docs/* +%{_mandir}/man1/* +%doc README README.rh-upload TODO LICENSE ChangeLog doc/* %config(noreplace) %{_sysconfdir}/sos.conf %changelog +* Fir Mar 26 2010 Adam Stokes <ajs at redhat dot com> = 1.9-3 +- fix setup.py to autocompile translations and man pages + * Fri Mar 19 2010 Adam Stokes <ajs at redhat dot com> = 1.9-2 - updated translations diff --git a/sos/__init__.py b/sos/__init__.py index e69de29b..20a47c4d 100644 --- a/sos/__init__.py +++ b/sos/__init__.py @@ -0,0 +1,26 @@ +## Copyright 2010 Red Hat, Inc. +## Author: Adam Stokes <astokes@fedoraproject.org> + +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. + +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +import gettext + +gettext_dir = "::LOCALEDIR::" +gettext_app = "sos" + +gettext.bindtextdomain(gettext_app, gettext_dir) + +def _sos(msg): + return gettext.dgettext(gettext_app, msg) diff --git a/sos/plugins/general.py b/sos/plugins/general.py index 2f6a8e7b..87b7e310 100644 --- a/sos/plugins/general.py +++ b/sos/plugins/general.py @@ -44,6 +44,9 @@ class general(sos.plugintools.PluginBase): self.collectExtOutput("/bin/hostname", root_symlink = "hostname") self.collectExtOutput("/bin/date", root_symlink = "date") self.collectExtOutput("/usr/bin/uptime", root_symlink = "uptime") + self.collectExtOutput("/bin/dmesg") + self.addCopySpec("/root/anaconda-ks.cfg") + self.collectExtOutput("/usr/sbin/alternatives --display java", root_symlink = "java") if self.getOption('all_logs'): rhelver = self.policy().rhelVersion() diff --git a/sos/plugintools.py b/sos/plugintools.py index 1562440a..f0c931c1 100644 --- a/sos/plugintools.py +++ b/sos/plugintools.py @@ -29,6 +29,7 @@ This is the base class for sosreport plugins """ from sos.helpers import * +from sos import _sos as _ import os, os.path, sys, string, glob, re, traceback import shutil from stat import * diff --git a/sos/sosreport.py b/sos/sosreport.py index e4dc05b0..814f07cb 100755 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -43,10 +43,11 @@ from sos.helpers import importPlugin import signal from stat import ST_UID, ST_GID, ST_MODE, ST_CTIME, ST_ATIME, ST_MTIME, S_IMODE from time import strftime, localtime -import gettext from itertools import * from collections import deque +from sos import _sos as _ + __version__ = 1.9 if os.path.isfile('/etc/fedora-release'): __distro__ = 'Fedora' @@ -351,9 +352,6 @@ def sosreport(opts): os.mkdir(logdir, 0755) os.mkdir(rptdir, 0755) - # initialize i18n language localization - gettext.install('sos', '/usr/share/locale', unicode=False) - # initialize logging soslog = logging.getLogger('sos') soslog.setLevel(logging.DEBUG) diff --git a/test/__init__.py b/tests/__init__.py index 8b137891..8b137891 100644 --- a/test/__init__.py +++ b/tests/__init__.py diff --git a/test/commons.py b/tests/commons.py index de2906fd..de2906fd 100644 --- a/test/commons.py +++ b/tests/commons.py diff --git a/test/fixture/__init__.py b/tests/fixture/__init__.py index e69de29b..e69de29b 100644 --- a/test/fixture/__init__.py +++ b/tests/fixture/__init__.py diff --git a/test/fixture/dummyPluginDisabled.py b/tests/fixture/dummyPluginDisabled.py index c86e7b44..c86e7b44 100644 --- a/test/fixture/dummyPluginDisabled.py +++ b/tests/fixture/dummyPluginDisabled.py diff --git a/test/fixture/dummyPluginEnabled.py b/tests/fixture/dummyPluginEnabled.py index 9074ae6b..9074ae6b 100644 --- a/test/fixture/dummyPluginEnabled.py +++ b/tests/fixture/dummyPluginEnabled.py diff --git a/test/testbasic.py b/tests/testbasic.py index 231481ae..231481ae 100644 --- a/test/testbasic.py +++ b/tests/testbasic.py diff --git a/test/testldap.py b/tests/testldap.py index 19511f74..19511f74 100644 --- a/test/testldap.py +++ b/tests/testldap.py |