Skip to content

Commit

Permalink
Merge pull request #1 from JohnKepplers/master
Browse files Browse the repository at this point in the history
fixed version_id
  • Loading branch information
andrewlukoshko authored Jul 27, 2021
2 parents 83d4b20 + a1cd078 commit 7dac8b4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import platform

from leapp.exceptions import StopActorExecutionError
from leapp.libraries.stdlib import run, CalledProcessError
Expand Down Expand Up @@ -60,6 +61,7 @@ def get_env_vars():

def get_os_release(path):
"""Retrieve data about System OS release from provided file."""
os_version = '.'.join(platform.dist()[1].split('.')[:2])
try:
with open(path) as f:
data = dict(l.strip().split('=', 1) for l in f.readlines() if '=' in l)
Expand All @@ -68,7 +70,7 @@ def get_os_release(path):
name=data.get('NAME', '').strip('"'),
pretty_name=data.get('PRETTY_NAME', '').strip('"'),
version=data.get('VERSION', '').strip('"'),
version_id=data.get('VERSION_ID', '').strip('"'),
version_id=os_version,
variant=data.get('VARIANT', '').strip('"') or None,
variant_id=data.get('VARIANT_ID', '').strip('"') or None
)
Expand Down

0 comments on commit 7dac8b4

Please sign in to comment.