21 lines
565 B
Python
21 lines
565 B
Python
import platform
|
|
|
|
import sau.errors
|
|
import sau.freebsd
|
|
import sau.gentoo
|
|
|
|
def get_platform():
|
|
platform_mod = None
|
|
if platform.system() == 'FreeBSD':
|
|
platform_mod = sau.freebsd
|
|
elif platform.system() == 'Linux':
|
|
if 'gentoo' in platform.release():
|
|
platform_mod = sau.gentoo
|
|
|
|
if not platform_mod:
|
|
raise sau.errors.PlatformNotSupported("System: {} Release: {} Version: {} is not supported".format(
|
|
platform.system(),
|
|
platform.release(),
|
|
platform.version()))
|
|
return platform_mod
|