fabtools.system¶
System settings¶
OS detection¶
- fabtools.system.distrib_id()[source]¶
Get the OS distribution ID.
Returns a string such as "Debian", "Ubuntu", "RHEL", "CentOS", "SLES", "Fedora", "Archlinux", "Gentoo", "SunOS"...
Example:
from fabtools.system import distrib_id if distrib_id() != 'Debian': abort(u"Distribution is not supported")
- fabtools.system.distrib_family()[source]¶
Get the distribution family.
Returns one of debian, redhat, arch, gentoo, sun, other.
- fabtools.system.distrib_release()[source]¶
Get the release number of the distribution.
Example:
from fabtools.system import distrib_id, distrib_release if distrib_id() == 'CentOS' and distrib_release() == '6.1': print(u"CentOS 6.2 has been released. Please upgrade.")
Hardware detection¶
Hostname¶
Kernel parameters¶
Locales¶
Time¶
- fabtools.system.time()[source]¶
Return the current time in seconds since the Epoch.
Same as time.time()