provision: Add Fedora support.

This commit is contained in:
rht
2018-12-17 18:41:03 +00:00
committed by Tim Abbott
parent 88cf6777d0
commit b732fe819e
3 changed files with 44 additions and 12 deletions

View File

@@ -329,7 +329,12 @@ def parse_lsb_release():
with open('/etc/redhat-release', 'r') as fp:
info = fp.read().strip().split(' ')
vendor = info[0]
codename = 'centos' + info[3][0]
if os.path.exists("/etc/centos-release"):
# E.g. "CentOS Linux release 7.5.1804 (Core)"
codename = vendor.lower() + info[3][0]
else:
# E.g. "Fedora release 29 (Twenty Nine)"
codename = vendor.lower() + info[2]
distro_info = dict(
DISTRIB_CODENAME=codename,
DISTRIB_ID=vendor