def checked_do(who, command, data=None):
  address = name_to_ip(who) if cfg.ip_via_api else who
  result = talk_to_agent(address, command, data=data)
  if result is None or result['result'] != 'ok':
    raise Exception('{0}{1} failed: {2}'.format(who, command, result))
  return result


# Process management
Issue a rest call and verify the response indicates no errors.
dataset/ETHPy150Open GoogleCloudPlatform/compute-hadoop-java-python/util.py/checked_do