def CallRPCMethod(transport_cb, method, args, version=None):
  """Send a RPC request via a transport and return the response.

  """
  assert callable(transport_cb)
  t1 = time.time() * 1000
  request_msg = FormatRequest(method, args, version=version)
  t2 = time.time() * 1000
  # Send request and wait for response
  response_msg = transport_cb(request_msg)
  t3 = time.time() * 1000
  (success, result, resp_version) = ParseResponse(response_msg)
  t4 = time.time() * 1000
  logging.info("CallRPCMethod %s: format: %dms, sock: %dms, parse: %dms",
               method, int(t1 - t2), int(t3 - t2), int(t4 - t3))
  # Verify version if there was one in the response
  if resp_version is not None and resp_version != version:
    raise LuxiError("RPC version mismatch, client %s, response %s" %
                    (version, resp_version))

  if success:
    return result

  errors.MaybeRaise(result)
  raise RequestError(result)
dataset/ETHPy150Open ganeti/ganeti/lib/rpc/client.py/CallRPCMethod/swapped operands of `-`