def get_volume_group_info(vg):
 (out, err) = execute('vgs', '--noheadings', '--nosuffix', '--separator', '|', '--units', 'b', '-o', 'vg_size,vg_free', vg, run_as_root=True)
 info = out.split('|')
 if (len(info) != 2):
  raise RuntimeError((_('vg %s must be LVM volume group') % vg))
 return {'total': int(info[0]), 'free': int(info[1]), 'used': (int(info[0]) - int(info[1]))}

def get_volume_group_info ( vg ) : ( out , err ) = execute ( 'vgs' , '--noheadings' , '--nosuffix' , '--separator' , '|' , '--units' , 'b' , '-o' , 'vg_size,vg_free' , vg , run_as_root = True ) info = out . split ( '|' ) if ( len ( info ) != 2 ) : raise RuntimeError ( ( _ ( 'vg %s must be LVM volume group' ) % vg ) ) return { 'total' : int ( info [ 0 ] ) , 'free' : int ( info [ 1 ] ) , 'used' : ( int ( info [ 0 ] ) - int ( info [ 1 ] ) ) }
return free/used/total space info for a volume group in bytes .