| Server IP : 118.27.122.120 / Your IP : 216.73.216.136 Web Server : Apache System : Linux web0216.sh.tyo1 4.18.0-553.141.2.lve.el7h.x86_64 #1 SMP Wed Jul 8 17:20:31 UTC 2026 x86_64 User : r4834334 ( 11094) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/sos/policies/ |
Upload File : |
from sos.plugins import DebianPlugin
from sos.policies import PackageManager, LinuxPolicy
import os
class DebianPolicy(LinuxPolicy):
distro = "Debian"
vendor = "the Debian project"
vendor_url = "http://www.debian.org/"
ticket_number = ""
_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"
def __init__(self, sysroot=None):
super(DebianPolicy, self).__init__(sysroot=sysroot)
self.ticket_number = ""
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]
def _get_pkg_name_for_binary(self, binary):
# for binary not specified inside {..}, return binary itself
return {
"xz": "xz-utils"
}.get(binary, binary)
@classmethod
def check(cls):
"""This method checks to see if we are running on Debian.
It returns True or False."""
return os.path.isfile('/etc/debian_version')
def dist_version(self):
try:
with open('/etc/lsb-release', 'r') as fp:
rel_string = fp.read()
if "wheezy/sid" in rel_string:
return 6
elif "jessie/sid" in rel_string:
return 7
return False
except IOError:
return False
# vim: set et ts=4 sw=4 :