tests: this_is_rhel function return true for CentOS or RHEL

Related: rhbz#1785154
This commit is contained in:
Brian C. Lane 2020-02-05 14:36:35 -08:00
parent a08bd603d0
commit 2c9989a06d

View File

@ -48,10 +48,11 @@ def get_file_magic(filename):
return details
def this_is_rhel():
"""Check to see if the tests are running on RHEL
"""Check to see if the tests are running on RHEL or CentOS
"""
NAMES = ["Red Hat Enterprise Linux", "CentOS"]
release = open("/etc/system-release", "r").read()
return "Red Hat Enterprise Linux" in release
return any(True for n in NAMES if n in release)
def create_git_repo():
"""Create a git repo in a tmpdir