def _SendFileToServer(pool, fullpath, subpath, basename, rebalance):
 fp = FileCopyWrapper(rebalance, subpath, basename, fullpath)
 try:
  headers = {'Content-Length': 0}
  res = pool.urlopen('POST', '/rebalance/copy-file', headers=headers, body=fp)
  if (res.status != constants.RESPONSE_OK):
   return False
 except urllib3.exceptions.MaxRetryError:
  logging.warning('Failed to send file %s', fullpath)
  return False
 finally:
  fp.close()
 return True

def _SendFileToServer ( pool , fullpath , subpath , basename , rebalance ) : fp = FileCopyWrapper ( rebalance , subpath , basename , fullpath ) try : headers = { 'Content-Length' : 0 } res = pool . urlopen ( 'POST' , '/rebalance/copy-file' , headers = headers , body = fp ) if ( res . status != constants . RESPONSE_OK ) : return False except urllib3 . exceptions . MaxRetryError : logging . warning ( 'Failed to send file %s' , fullpath ) return False finally : fp . close ( ) return True
sends a specific data store file to the server .