diff options
-rw-r--r-- | sos/policies/distros/debian.py | 12 | ||||
-rw-r--r-- | sos/policies/package_managers/dpkg.py | 23 |
2 files changed, 26 insertions, 9 deletions
diff --git a/sos/policies/distros/debian.py b/sos/policies/distros/debian.py index 29c74dc9..69a92192 100644 --- a/sos/policies/distros/debian.py +++ b/sos/policies/distros/debian.py @@ -8,7 +8,7 @@ from sos.report.plugins import DebianPlugin from sos.policies.distros import LinuxPolicy -from sos.policies.package_managers import PackageManager +from sos.policies.package_managers.dpkg import DpkgPackageManager import os @@ -18,9 +18,6 @@ class DebianPolicy(LinuxPolicy): vendor = "the Debian project" vendor_urls = [('Community Website', 'https://www.debian.org/')] ticket_number = "" - _debq_cmd = "dpkg-query -W -f='${Package}|${Version}\\n'" - _debv_cmd = "dpkg --verify" - _debv_filter = "" name_pattern = 'friendly' valid_subclasses = [DebianPlugin] PATH = "/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" \ @@ -32,11 +29,8 @@ class DebianPolicy(LinuxPolicy): super(DebianPolicy, self).__init__(sysroot=sysroot, init=init, probe_runtime=probe_runtime) self.ticket_number = "" - self.package_manager = PackageManager(query_command=self._debq_cmd, - verify_command=self._debv_cmd, - verify_filter=self._debv_filter, - chroot=sysroot, - remote_exec=remote_exec) + self.package_manager = DpkgPackageManager(chroot=sysroot, + remote_exec=remote_exec) self.valid_subclasses += [DebianPlugin] def _get_pkg_name_for_binary(self, binary): diff --git a/sos/policies/package_managers/dpkg.py b/sos/policies/package_managers/dpkg.py new file mode 100644 index 00000000..7619e929 --- /dev/null +++ b/sos/policies/package_managers/dpkg.py @@ -0,0 +1,23 @@ +# Copyright 2020 Red Hat, Inc. Jake Hunsaker <jhunsake@redhat.com> + +# This file is part of the sos project: https://github.com/sosreport/sos +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions of +# version 2 of the GNU General Public License. +# +# See the LICENSE file in the source distribution for further information. + +from sos.policies.package_managers import PackageManager + + +class DpkgPackageManager(PackageManager): + """Subclass for dpkg-based distrubitons + """ + + query_command = "dpkg-query -W -f='${Package}|${Version}\\n'" + verify_command = "dpkg --verify" + verify_filter = "" + + +# vim: set et ts=4 sw=4 : |