def get_host_with_role(self, role):
    """ Queries the AppController to find a host running the named role.

    Args:
      role: A str indicating the name of the role we wish to find a hoster of.
    Returns:
      A str containing the publicly accessible hostname (IP address or FQDN)
      of one machine that runs the specified service. Note that if multiple
      services host the named role, only one is returned, and if information
      about the named role couldn't be found, the empty string is returned.
    """
    acc = self.get_appcontroller_client()
    if self.cache['get_role_info']:
      nodes = self.cache['get_role_info']
    else:
      try:
        nodes = acc.get_role_info()
        self.cache['get_role_info'] = nodes
      except Exception as err:
        logging.exception(err)
        return ''
    for node in nodes:
      if role in node['jobs']:
        return node['public_ip']
    return ''
dataset/ETHPy150Open AppScale/appscale/AppDashboard/lib/app_dashboard_helper.py/AppDashboardHelper.get_host_with_role/original