From 2c9989a06d7102fc8e5c0cd45021470e06211e62 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Wed, 5 Feb 2020 14:36:35 -0800 Subject: [PATCH] tests: this_is_rhel function return true for CentOS or RHEL Related: rhbz#1785154 --- tests/lib.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/lib.py b/tests/lib.py index fdff6fb4..639f7439 100644 --- a/tests/lib.py +++ b/tests/lib.py @@ -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