Comments (7)
And here's why:
def pkgByName(self, name):
"""
Return a single package that matches name.
"""
try:
self.AllPkgsByName(name)[-1]
except Exception:
return None
Hashing out that try block:
rm -rf sosreport-localhost.* && sosreport -vvv --batch --debug 2>&1 | tee /tmp/log | less;
sosreport (version 2.3)
plugin abrt does not install, skipping: 'PackageManager' object has no attribute 'AllPkgsByName'
Traceback (most recent call last):
File "/usr/sbin/sosreport", line 23, in
main(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 961, in main
sos.execute()
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 921, in execute
self.load_plugins()
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 454, in load_plugins
if self._is_inactive(plugbase, plugin_class):
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 394, in _is_inactive
return (not pluginClass(self.get_commons()).checkenabled() and
File "/usr/lib/python2.7/site-packages/sos/plugins/abrt.py", line 27, in checkenabled
return self.isInstalled("abrt-cli") or
File "/usr/lib/python2.7/site-packages/sos/plugins/init.py", line 166, in isInstalled
print "pkgByName: %s" % self.policy().pkgByName(package_name)
File "/usr/lib/python2.7/site-packages/sos/policies/init.py", line 197, in pkgByName
return self.package_manager.pkgByName(pkg)
File "/usr/lib/python2.7/site-packages/sos/policies/init.py", line 73, in pkgByName
self.AllPkgsByName(name)[-1]
AttributeError: 'PackageManager' object has no attribute 'AllPkgsByName'
So looks like this has been totally bust since Feb at least :-)
from sos.
Fixing the one-char typo ('All' for 'all') gives:
# rm -rf sosreport-localhost.* && sosreport -vvv --batch --debug 2>&1 | tee /tmp/log | less;
sosreport (version 2.3)
plugin abrt does not install, skipping: global name 'shell_out' is not defined
Traceback (most recent call last):
File "/usr/sbin/sosreport", line 23, in <module>
main(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 961, in main
sos.execute()
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 921, in execute
self.load_plugins()
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 454, in load_plugins
if self._is_inactive(plugbase, plugin_class):
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 394, in _is_inactive
return (not pluginClass(self.get_commons()).checkenabled() and
File "/usr/lib/python2.7/site-packages/sos/plugins/abrt.py", line 27, in checkenabled
return self.isInstalled("abrt-cli") or \
File "/usr/lib/python2.7/site-packages/sos/plugins/__init__.py", line 166, in isInstalled
print "pkgByName: %s" % self.policy().pkgByName(package_name)
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 197, in pkgByName
return self.package_manager.pkgByName(pkg)
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 73, in pkgByName
self.allPkgsByName(name)[-1]
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 59, in allPkgsByName
return fnmatch.filter(self.allPkgs().keys(), name)
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 98, in allPkgs
self.packages = self.getPackageList()
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 83, in getPackageList
pkg_list = shell_out(self.query_command).splitlines()
NameError: global name 'shell_out' is not defined
Adding the missing import for sos.utilities.shell_out thens says:
# rm -rf sosreport-localhost.* && sosreport -vvv --batch --debug 2>&1 | tee /tmp/log | less;
sosreport (version 2.3)
plugin abrt does not install, skipping: list index out of range
Traceback (most recent call last):
File "/usr/sbin/sosreport", line 23, in <module>
main(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 961, in main
sos.execute()
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 921, in execute
self.load_plugins()
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 454, in load_plugins
if self._is_inactive(plugbase, plugin_class):
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 394, in _is_inactive
return (not pluginClass(self.get_commons()).checkenabled() and
File "/usr/lib/python2.7/site-packages/sos/plugins/abrt.py", line 27, in checkenabled
return self.isInstalled("abrt-cli") or \
File "/usr/lib/python2.7/site-packages/sos/plugins/__init__.py", line 166, in isInstalled
print "pkgByName: %s" % self.policy().pkgByName(package_name)
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 198, in pkgByName
return self.package_manager.pkgByName(pkg)
File "/usr/lib/python2.7/site-packages/sos/policies/__init__.py", line 74, in pkgByName
self.allPkgsByName(name)[-1]
IndexError: list index out of range
This would have been caught by the try block I commented out but I think it's better to test the length of the array and return None explicitly if it has zero length, e.g.:
def pkgByName(self, name):
"""
Return a single package that matches name.
"""
# try:
pkgmatches = self.allPkgsByName(name)
if (len(pkgmatches) != 0):
return self.allPkgsByName(name)[-1]
else:
return None
# except Exception:
# return None
I have lots of this now:
checking packages:
('kexec-tools',)
pkgByName: kexec-tools
Is installed(kexec-tools): True
checking packages:
('openldap', 'nss-pam-ldapd')
pkgByName: openldap
Is installed(openldap): True
checking packages:
('openssl',)
pkgByName: openssl
Is installed(openssl): True
And I hit the original exception I was trying to debug when I noticed this:
Traceback (most recent call last):
File "/usr/sbin/sosreport", line 23, in <module>
main(sys.argv[1:])
File "/usr/lib/python2.7/site-packages/sos/sosreport.py", line 961, in main
sos.execute()
TypeError: coercing to Unicode: need string or buffer, NoneType found
> /usr/lib64/python2.7/posixpath.py(133)islink()
-> st = os.lstat(path)
(Pdb)
(which is a known issue that Keith already posted a fix to BZ for).
Don't think I've ever been so happy to see a python backtrace!
from sos.
Fixed in commit 3cce6b
from sos.
Oops, using commit doesn't work if you haven't pushed it..
from sos.
Fixed in commit 3cce6b
from sos.
wtf?
from sos.
Not enough chars... commit 3cce6b2 dammit.
from sos.
Related Issues (20)
- sos report can load overlay kmod HOT 3
- [hpssm] controller collection misses Gen10+ controllers and above slot 9.
- Add Ansible Automation Platform as a cluster option in sos collect HOT 3
- [cleaner] clean mail addresses (e.g. from maillog)
- Add masakari logs HOT 6
- [networking] sos will not obfuscate wifi password in netplan
- How to Handle SELinux Denials on Default Temp Dir HOT 3
- [Feedback requested] Dropping redirectors and updating text output for sosreport HOT 5
- [discussion] What is the purpose of "Signed-off-by:" DCO requirement? HOT 7
- sos clean should obfuscate hostnames like dhcp-192-168-0-66 HOT 9
- Required support for data collections within the sosreport HOT 6
- sos report --all-logs -a does not gather all the older syslog, kern.log or boot.log files for Ubuntu HOT 4
- sos collect in Juju environment HOT 2
- [cleaner] Skip obfuscation of too short (sub)strings HOT 1
- [flatpak] Missing flatpak versions break sos execution HOT 1
- RFE: run systemd-analyze on various 'targets' HOT 4
- [component] report ignores --tmp-dir from preset
- Adding preset leaves its temp directory
- sos report masking not working if we not used following plugins - host, login, networking. HOT 1
- [slurm] Could not open conf file /etc/slurm/slurm.conf because the slurmd is running in `Configless` mode. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sos.