def _parse_os_release():
 filename = '/etc/os-release'
 if (not os.path.isfile(filename)):
  filename = '/usr/lib/os-release'
 data = dict()
 with salt.utils.fopen(filename) as ifile:
  regex = re.compile('^([\\w]+)=(?:\'|")?(.*?)(?:\'|")?$')
  for line in ifile:
   match = regex.match(line.strip())
   if match:
    data[match.group(1)] = re.sub('\\\\([$"\\\'\\\\`])', '\\1', match.group(2))
 return data

def _parse_os_release ( ) : filename = '/etc/os-release' if ( not os . path . isfile ( filename ) ) : filename = '/usr/lib/os-release' data = dict ( ) with salt . utils . fopen ( filename ) as ifile : regex = re . compile ( '^([\\w]+)=(?:\'|")?(.*?)(?:\'|")?$' ) for line in ifile : match = regex . match ( line . strip ( ) ) if match : data [ match . group ( 1 ) ] = re . sub ( '\\\\([$"\\\'\\\\`])' , '\\1' , match . group ( 2 ) ) return data
parse /etc/os-release and return a parameter dictionary see URL for specification of the file format .