From d0dcb39ea94e647f97184f0691dfa2592d65b8ac Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Mon, 15 Apr 2019 12:33:24 -0400 Subject: [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 Signed-off-by: Bryn M. Reeves --- sos/plugins/unpackaged.py | 2 +- sos/policies/redhat.py | 7 ------- 2 files changed, 1 insertion(+), 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: -- cgit