From b600776dd0b0b7c1dc48c0ffd547001b3a3399c0 Mon Sep 17 00:00:00 2001 From: Eric Desrochers Date: Wed, 6 Dec 2017 12:07:39 -0500 Subject: [sosreport] Fix debian policy PackageManager misusage. Python does not impose any kind of ordering on keyword args, but if the keywords are missing it will still attempt to honour the call by mapping positional call arguments to corresponding keywords in the declaration. In this case the Debian policy invokes the PackageManager call as though it only uses positional arguments. This is undoubtedly wrong. Resolves: #1162 Signed-off-by: Eric Desrochers Signed-off-by: Bryn M. Reeves --- sos/policies/debian.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sos/policies/debian.py b/sos/policies/debian.py index dc7f2e68..c2e0a2dd 100644 --- a/sos/policies/debian.py +++ b/sos/policies/debian.py @@ -10,8 +10,9 @@ class DebianPolicy(LinuxPolicy): vendor_url = "http://www.debian.org/" report_name = "" ticket_number = "" - package_manager = PackageManager( - "dpkg-query -W -f='${Package}|${Version}\\n'") + _debq_cmd = "dpkg-query -W -f='${Package}|${Version}\\n'" + _debv_cmd = "dpkg --verify" + _debv_filter = "" valid_subclasses = [DebianPlugin] PATH = "/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" \ + ":/usr/local/sbin:/usr/local/bin" @@ -20,8 +21,11 @@ class DebianPolicy(LinuxPolicy): super(DebianPolicy, self).__init__(sysroot=sysroot) self.report_name = "" self.ticket_number = "" - self.package_manager = PackageManager( - "dpkg-query -W -f='${Package}|${Version}\\n'") + self.package_manager = PackageManager(query_command=self._debq_cmd, + verify_command=self._debv_cmd, + verify_filter=self._debv_filter, + chroot=sysroot) + self.valid_subclasses = [DebianPlugin] @classmethod -- cgit