Skip to content

Commit

Permalink
Added temporary workaround for CentOS 7 os-release id bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Kuzmenko committed Feb 29, 2016
1 parent 95db870 commit a3b806d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions salt/grains/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,13 @@ def os_data():
grains['osfullname'] = \
grains.get('lsb_distrib_id', osname).strip()
if 'osrelease' not in grains:
# NOTE: This is a workaround for CentOS 7 os-release bug
# https://bugs.centos.org/view.php?id=8359
# /etc/os-release contains no minor distro release number so we fall back to parse
# /etc/centos-release file instead.
# Commit introducing this comment should be reverted after the upstream bug is released.
if 'CentOS Linux 7' in grains.get('lsb_distrib_codename', ''):
grains.pop('lsb_distrib_release', None)
grains['osrelease'] = \
grains.get('lsb_distrib_release', osrelease).strip()
grains['oscodename'] = grains.get('lsb_distrib_codename',
Expand Down

0 comments on commit a3b806d

Please sign in to comment.