@staticmethod
  def ParseRedhatRelease(release_file='/etc/redhat-release'):
    f = open(release_file)
    lines = f.readlines()
    f.close()
    if not lines:
      return (None, None, None, None)
    line0 = lines[0]
    g = re.match(r'(\S+) release (\d+) \(([^)]*)\)', line0)
    if not g:
      return (None, None, None, None)
    (osname, version, label) = (g.group(1), g.group(2), g.group(3))
    return (osname, label, osname, version)
Parses the /etc/redhat-release file.
dataset/ETHPy150Open GoogleCloudPlatform/compute-image-packages/legacy/gcimagebundle/gcimagebundlelib/fedora.py/Fedora.ParseRedhatRelease