aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Desrochers <eric.desrochers@canonical.com>2017-12-06 12:07:39 -0500
committerBryn M. Reeves <bmr@redhat.com>2018-04-16 16:18:34 +0100
commitb600776dd0b0b7c1dc48c0ffd547001b3a3399c0 (patch)
tree818734aa89b40d4ad046485a50355a84dd96fb9a
parent42b25c7505ac6ed02d0b179243896aa7c8eac49b (diff)
downloadsos-b600776dd0b0b7c1dc48c0ffd547001b3a3399c0.tar.gz
[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 <eric.desrochers@canonical.com> Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/policies/debian.py12
1 files 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