| Server IP : 104.21.37.246 / Your IP : 104.23.243.32 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/2388321/root/usr/lib/python2.6/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/"
report_name = ""
ticket_number = ""
package_manager = PackageManager(
"dpkg-query -W -f='${Package}|${Version}\\n' \*")
valid_subclasses = [DebianPlugin]
PATH = "/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" \
+ ":/usr/local/sbin:/usr/local/bin"
def __init__(self):
super(DebianPolicy, self).__init__()
self.report_name = ""
self.ticket_number = ""
self.package_manager = PackageManager(
"dpkg-query -W -f='${Package}|${Version}\\n' \*")
self.valid_subclasses = [DebianPlugin]
@classmethod
def check(self):
"""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:
return False
# vim: et ts=4 sw=4