Esempio n. 1
0
def _get_server_properties():
  global _api_cache

  if not _api_cache: # If we need to refresh the list or if previously no servers were up 
    _api_cache_lock.acquire()

    try:
      if not _api_cache:

        servers = []
        sentry_servers = get_children_data(ensemble=get_sentry_server_ha_zookeeper_quorum(), namespace=get_sentry_server_ha_zookeeper_namespace())

        for data in sentry_servers:
          server = json.loads(data.decode("utf-8"))
          servers.append({'hostname': server['address'], 'port': server['sslPort'] if server['sslPort'] else server['port']})

        _api_cache = servers
    finally:
      _api_cache_lock.release()

  return _api_cache
Esempio n. 2
0
 def test_get_collections(self):
   db = get_children_data(zkensemble(), '/solr')