ovirt-imageio/test/distro.py
Albert Esteve fc6e58d9e6 reuse: addheader test/*.py
Add SPDX header to python files with
the 'py' extension in the test directory.

Signed-off-by: Albert Esteve <aesteve@redhat.com>
2022-10-18 13:04:20 +02:00

20 lines
473 B
Python

# SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
def is_fedora(version=""):
return _check("Fedora release {}".format(version))
def is_centos(version=""):
return _check("CentOS Stream release {}".format(version))
def is_rhel(version=""):
return _check("Red Hat Enterprise Linux release {}".format(version))
def _check(text):
with open("/etc/redhat-release") as f:
line = f.readline()
return text in line