Hackfut Security File Manager
Current Path:
/usr/lib/python2.6/site-packages/sos/policies
usr
/
lib
/
python2.6
/
site-packages
/
sos
/
policies
/
📁
..
📄
__init__.py
(13.17 KB)
📄
__init__.pyc
(16.93 KB)
📄
__init__.pyo
(16.93 KB)
📄
debian.py
(1.36 KB)
📄
debian.pyc
(2.01 KB)
📄
debian.pyo
(2.01 KB)
📄
osx.py
(300 B)
📄
osx.pyc
(769 B)
📄
osx.pyo
(769 B)
📄
redhat.py
(6.09 KB)
📄
redhat.pyc
(6.95 KB)
📄
redhat.pyo
(6.95 KB)
📄
ubuntu.py
(1.09 KB)
📄
ubuntu.pyc
(1.84 KB)
📄
ubuntu.pyo
(1.84 KB)
Editing: ubuntu.py
from __future__ import with_statement from sos.plugins import UbuntuPlugin, DebianPlugin from sos.policies.debian import DebianPolicy class UbuntuPolicy(DebianPolicy): distro = "Ubuntu" vendor = "Ubuntu" vendor_url = "http://www.ubuntu.com/" def __init__(self): super(UbuntuPolicy, self).__init__() self.valid_subclasses = [UbuntuPlugin, DebianPlugin] @classmethod def check(self): """This method checks to see if we are running on Ubuntu. It returns True or False.""" try: with open('/etc/lsb-release', 'r') as fp: return "Ubuntu" in fp.read() except: return False def dist_version(self): """ Returns the version stated in DISTRIB_RELEASE """ try: with open('/etc/lsb-release', 'r') as fp: lines = fp.readlines() for line in lines: if "DISTRIB_RELEASE" in line: return line.split("=")[1].strip() return False except: return False # vim: et ts=4 sw=4
Upload File
Create Folder