def _parse_btrfs_info(data):
 ret = {}
 for line in [line for line in data.split('\n') if line][:(-1)]:
  if line.startswith('Label:'):
   line = re.sub('Label:\\s+', '', line)
   (label, uuid_) = [tkn.strip() for tkn in line.split('uuid:')]
   ret['label'] = (((label != 'none') and label) or None)
   ret['uuid'] = uuid_
   continue
  if line.startswith(' DCTB devid'):
   dev_data = re.split('\\s+', line.strip())
   dev_id = dev_data[(-1)]
   ret[dev_id] = {'device_id': dev_data[1], 'size': dev_data[3], 'used': dev_data[5]}
 return ret

def _parse_btrfs_info ( data ) : ret = { } for line in [ line for line in data . split ( '\n' ) if line ] [ : ( - 1 ) ] : if line . startswith ( 'Label:' ) : line = re . sub ( 'Label:\\s+' , '' , line ) ( label , uuid_ ) = [ tkn . strip ( ) for tkn in line . split ( 'uuid:' ) ] ret [ 'label' ] = ( ( ( label != 'none' ) and label ) or None ) ret [ 'uuid' ] = uuid_ continue if line . startswith ( ' DCTB devid' ) : dev_data = re . split ( '\\s+' , line . strip ( ) ) dev_id = dev_data [ ( - 1 ) ] ret [ dev_id ] = { 'device_id' : dev_data [ 1 ] , 'size' : dev_data [ 3 ] , 'used' : dev_data [ 5 ] } return ret
parse btrfs device info data .