def get_volume_size(path):
 try:
  (out, _err) = utils.execute('blockdev', '--getsize64', path, run_as_root=True)
 except processutils.ProcessExecutionError:
  if (not utils.path_exists(path)):
   raise exception.VolumeBDMPathNotFound(path=path)
  else:
   raise
 return int(out)

def get_volume_size ( path ) : try : ( out , _err ) = utils . execute ( 'blockdev' , '--getsize64' , path , run_as_root = True ) except processutils . ProcessExecutionError : if ( not utils . path_exists ( path ) ) : raise exception . VolumeBDMPathNotFound ( path = path ) else : raise return int ( out )
calculate the volume size .