Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPU workflow config actor: use distro.version() if python minor version >= 9 #135

Merged
Merged
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
import platform

from leapp.exceptions import StopActorExecutionError
Expand Down Expand Up @@ -47,7 +48,12 @@ def get_os_release(path):
:return: `OSRelease` model if the file can be parsed
:raises: `IOError`
"""
os_version = '.'.join(platform.dist()[1].split('.')[:2])
if sys.version_info.minor < 9:
os_version = platform.dist()[1]
else:
import distro
os_version = distro.version()
os_version = '.'.join(os_version.split('.')[:2])
try:
with open(path) as f:
data = dict(l.strip().split('=', 1) for l in f.readlines() if '=' in l)
Expand Down
Loading