未验证 提交 36676fb4 编写于 作者: C Caio Carrara

Merge remote-tracking branch 'clebergnu/drop_platform_dist'

Signed-off-by: NCaio Carrara <ccarrara@redhat.com>
......@@ -19,7 +19,6 @@ it's running under.
import os
import re
import platform
__all__ = ['LinuxDistro',
......@@ -261,41 +260,6 @@ class Probe(object):
return distro
class StdLibProbe(Probe):
"""
Probe that uses the Python standard library builtin detection
This Probe has a lower score on purpose, serving as a fallback
if no explicit (and hopefully more accurate) probe exists.
"""
def get_distro(self):
name = None
version = UNKNOWN_DISTRO_VERSION
release = UNKNOWN_DISTRO_RELEASE
d_name, d_version_release, _ = platform.dist()
if d_name:
name = d_name
if '.' in d_version_release:
d_version, d_release = d_version_release.split('.', 1)
version = d_version
release = d_release
else:
version = d_version_release
arch = os.uname()[4]
if name is not None:
distro = LinuxDistro(name, version, release, arch)
else:
distro = UNKNOWN_DISTRO
return distro
class RedHatProbe(Probe):
"""
......@@ -446,7 +410,6 @@ register_probe(FedoraProbe)
register_probe(AmazonLinuxProbe)
register_probe(DebianProbe)
register_probe(SUSEProbe)
register_probe(StdLibProbe)
def detect():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册