Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.11 KB

README.md

File metadata and controls

51 lines (34 loc) · 1.11 KB

lsb_release_ex

LSB release detection module for Debian/Ubuntu and Red Hat.

Ehanced Linux Standard Base version reporting module for Debian/Ubuntu and Red Hat series. It is inspired by Debian implementaion in lsb-release.

Installation

Install by pip:

pip install lsb_release_ex

or download the latest version from github:

git clone git://github.com/likema/lsb_release_ex.git
cd lsb_release_ex
python setup.py install

Packaging

Ubuntu/Debian

git clone git://github.com/likema/lsb_release_ex.git
cd lsb_release_ex
dpkg-buildpackage -us -uc -rfakeroot

Usage

The sample runs just like

lsb_release -a

in Debian/Ubuntu.

import lsb_release_ex

distinfo = lsb_release_ex.get_distro_information()
verinfo = lsb_release_ex.check_modules_installed()

print '''LSB Version:    %s
Distributor ID: %s
Description:    %s
Release:        %s
Codename:       %s''' % (":".join(verinfo) if verinfo else None,
                         distinfo.get("ID"),
                         distinfo.get("DESCRIPTION"),
                         distinfo.get("RELEASE"),
                         distinfo.get("CODENAME"))