def _parse_xfs_info(data):
 ret = {}
 spr = re.compile('\\s+')
 entry = None
 for line in [spr.sub(' ', l).strip().replace(', ', ' ') for l in data.split('\n')]:
  if (not line):
   continue
  nfo = _xfs_info_get_kv(line)
  if (not line.startswith('=')):
   entry = nfo.pop(0)
   ret[entry[0]] = {'section': entry[(((entry[1] != '***') and 1) or 0)]}
  ret[entry[0]].update(dict(nfo))
 return ret

def _parse_xfs_info ( data ) : ret = { } spr = re . compile ( '\\s+' ) entry = None for line in [ spr . sub ( ' ' , l ) . strip ( ) . replace ( ', ' , ' ' ) for l in data . split ( '\n' ) ] : if ( not line ) : continue nfo = _xfs_info_get_kv ( line ) if ( not line . startswith ( '=' ) ) : entry = nfo . pop ( 0 ) ret [ entry [ 0 ] ] = { 'section' : entry [ ( ( ( entry [ 1 ] != '***' ) and 1 ) or 0 ) ] } ret [ entry [ 0 ] ] . update ( dict ( nfo ) ) return ret
parse output from "xfs_info" or "xfs_growfs -n" .