Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regresion from [sosreport] add per-plugin package verification lists #1155

Closed
BryanQuigley opened this issue Nov 28, 2017 · 6 comments
Closed

Comments

@BryanQuigley
Copy link
Contributor

All packages = lines don't appear to work in Ubuntu (and likely debian)

This results in less plugins running and none running based on installed packages. Two affected plugins are cups (which is what I bisected) and acpid.

On Trusty it goes from 59 to 50 plugins, on Artful from 63 to 53.

BryanQuigley pushed a commit to BryanQuigley/sos that referenced this issue Nov 29, 2017
Commit 82e4ee2 changes the order that PackageManager expects for
input.  Redhat policy was adopted to this change.
Debian/Ubuntu were not.

Closes: sosreport#1155

Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com>
@BryanQuigley
Copy link
Contributor Author

Actually I'm not sure this works for RedHat either:
PackageManager has the order defined as:
chroot=None, query_command=None,
verify_command=None, verify_filter=None

Redhat policy calls it
query_command=self._rpmq_cmd, verify_command=self._rpmv_cmd, verify_filter=self._rpmv_filter, chroot=sysroot

and debian and suse just seem to expect the query command to be first.

@BryanQuigley
Copy link
Contributor Author

With this fix 61 plugins run out of 63 expected. of the two different than expected
dmraid - I don't have installed, package= was added
boot - package names were added, but none patch debian/ubuntu

@bmr-cymru
Copy link
Member

Order is not significant for kwargs: it's mixing kwarg and non-kwarg call styles that causes the problem: the Debian policy is currently passing everything positionally which is incorrect for a method call that only uses keyword arguments.

That said: I prefer when we keep declaration/call ordering consistent because it makes the code easier to read and follow, so as well as reverting the argument ordering on the PM initialiser we need to ensure the Debian policy uses the correct kwarg names in the call.

@slashdd
Copy link

slashdd commented Nov 29, 2017

👍 +1 on fixing the ordering.

Another thing that can be modified IMHO is sos/policies/debian.py to be align with current RHEL policies.

diff --git a/sos/policies/debian.py b/sos/policies/debian.py
index dc7f2e6..258b841 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]

@BryanQuigley
Copy link
Contributor Author

This was fixed in 1162

@bmr-cymru
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants