aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2019-04-15 12:33:24 -0400
committerBryn M. Reeves <bmr@redhat.com>2019-05-14 11:46:33 +0100
commitd0dcb39ea94e647f97184f0691dfa2592d65b8ac (patch)
tree6b960069f750c5af3c4cf89693be0e871ba2c6fc
parent0100bd129e8fc809cc5b0258f6c0c7c64ad084ab (diff)
downloadsos-d0dcb39ea94e647f97184f0691dfa2592d65b8ac.tar.gz
[unpackaged|RedHat] Don't exit on failed file list query
The unpackaged plugin is the only one currently using a policy's file list as determined by PackageManager.all_files(). As such, we should not fail an entire sosreport run when the package file list query fails. Accordingly, the call to all_files() to populate and store the file list is now moved directly into the unpackaged plugin, rather than at policy initialization. Resolves: #1648 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/unpackaged.py2
-rw-r--r--sos/policies/redhat.py7
2 files changed, 1 insertions, 8 deletions
diff --git a/sos/plugins/unpackaged.py b/sos/plugins/unpackaged.py
index 10896d06..442ddc24 100644
--- a/sos/plugins/unpackaged.py
+++ b/sos/plugins/unpackaged.py
@@ -70,7 +70,7 @@ class Unpackaged(Plugin, RedHatPlugin):
all_fsystem = []
all_frpm = set(os.path.realpath(x)
for x in self.policy.mangle_package_path(
- self.policy.package_manager.files))
+ self.policy.package_manager.all_files()))
for d in get_env_path_list():
all_fsystem += all_files_system(d)
diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py
index 6aec7828..28d48d2d 100644
--- a/sos/policies/redhat.py
+++ b/sos/policies/redhat.py
@@ -66,19 +66,12 @@ class RedHatPolicy(LinuxPolicy):
self.valid_subclasses = [RedHatPlugin]
self.pkgs = self.package_manager.all_pkgs()
- files = self.package_manager.all_files()
# If rpm query failed, exit
if not self.pkgs:
print("Could not obtain installed package list", file=sys.stderr)
sys.exit(1)
- # If the files rpm query failed, exit
- if not files:
- print("Could not obtain the files list known to the package \
- manager", file=sys.stderr)
- sys.exit(1)
-
self.usrmove = self.check_usrmove(self.pkgs)
if self.usrmove: