yum: fix yum version comparison (#36573)

This commit is contained in:
Martin Krizek 2018-02-23 08:55:11 +01:00 committed by GitHub
parent a7db945ac6
commit a79a5439c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -347,7 +347,7 @@ def is_group_env_installed(name, conf_file, installroot='/'):
name_lower = name.lower()
my = yum_base(conf_file, installroot)
if yum.__version__ >= '3.4':
if yum.__version_info__ >= (3, 4):
groups_list = my.doGroupLists(return_evgrps=True)
else:
groups_list = my.doGroupLists()
@ -358,7 +358,7 @@ def is_group_env_installed(name, conf_file, installroot='/'):
if name_lower.endswith(group.name.lower()) or name_lower.endswith(group.groupid.lower()):
return True
if yum.__version__ >= '3.4':
if yum.__version_info__ >= (3, 4):
# list of the installed env_groups on the third index
envs = groups_list[2]
for env in envs: