Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,10 @@ def _distro_release_info(self):
# file), because we want to use what was specified as best as
# possible.
match = _DISTRO_RELEASE_BASENAME_PATTERN.match(basename)
if match:
if 'name' in distro_info \
and 'cloudlinux' in distro_info['name'].lower():
distro_info['id'] = 'cloudlinux'
elif match:
distro_info['id'] = match.group(1)
return distro_info
else:
Expand Down Expand Up @@ -1113,6 +1116,8 @@ def _distro_release_info(self):
# The name is always present if the pattern matches
self.distro_release_file = filepath
distro_info['id'] = match.group(1)
if 'cloudlinux' in distro_info['name'].lower():
distro_info['id'] = 'cloudlinux'
return distro_info
return {}

Expand Down
10 changes: 5 additions & 5 deletions tests/test_distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ def test_cloudlinux5_dist_release(self):
# Uses redhat-release only to get information.
# The id of 'rhel' can only be fixed with issue #109.
desired_outcome = {
'id': 'rhel',
'id': 'cloudlinux',
'codename': 'Vladislav Volkov',
'name': 'CloudLinux Server',
'pretty_name': 'CloudLinux Server 5.11 (Vladislav Volkov)',
Expand All @@ -851,7 +851,7 @@ def test_cloudlinux5_dist_release(self):
def test_cloudlinux6_dist_release(self):
# Same as above, only has redhat-release.
desired_outcome = {
'id': 'rhel',
'id': 'cloudlinux',
'codename': 'Oleg Makarov',
'name': 'CloudLinux Server',
'pretty_name': 'CloudLinux Server 6.8 (Oleg Makarov)',
Expand All @@ -865,7 +865,7 @@ def test_cloudlinux6_dist_release(self):

def test_cloudlinux7_dist_release(self):
desired_outcome = {
'id': 'rhel',
'id': 'cloudlinux',
'codename': 'Yury Malyshev',
'name': 'CloudLinux',
'pretty_name': 'CloudLinux 7.3 (Yury Malyshev)',
Expand Down Expand Up @@ -1486,7 +1486,7 @@ def test_cloudlinux5_release(self):
# Uses redhat-release only to get information.
# The id of 'rhel' can only be fixed with issue #109.
desired_outcome = {
'id': 'rhel',
'id': 'cloudlinux',
'codename': 'Vladislav Volkov',
'name': 'CloudLinux Server',
'pretty_name': 'CloudLinux Server 5.11 (Vladislav Volkov)',
Expand All @@ -1501,7 +1501,7 @@ def test_cloudlinux5_release(self):
def test_cloudlinux6_release(self):
# Same as above, only has redhat-release.
desired_outcome = {
'id': 'rhel',
'id': 'cloudlinux',
'codename': 'Oleg Makarov',
'name': 'CloudLinux Server',
'pretty_name': 'CloudLinux Server 6.8 (Oleg Makarov)',
Expand Down