anchor.diff:      {error, Error} ->
         throw({error_fetch_consul, Error})
     end.
  -cluster_nodes(0) ->
  -  cluster_nodes();
  -cluster_nodes(Count) ->
  -  try
  -    cluster_nodes()
  -  catch throw:{error_fetch_consul, Error} ->
  -    warning("Error fetching nodes from consul (~p retries left): ~p~n", [Count, Error]),
  -    timer:sleep(5000),
  -    cluster_nodes(Count - 1)
  -  end.
  +
   
   %% @private
   %% @spec agent_services() -> list()
  
positive.code:     false ->
        case register() of
          ok ->
            Nodes = cluster_nodes(10),
            join_cluster(Nodes);
          {error, 400}   ->
            err("Permission denied when registering node with Consul"),
            error;
  
negative.code:   ok;
  join_cluster(Nodes) ->
    info("Joining existing cluster: ~p", [Nodes]),
    Node = lists:nth(random:uniform(length(Nodes)), Nodes),
    info("Chosen node to join to: ~p", [Node]),
    application:stop(rabbit),
    mnesia:stop(),
    rabbit_mnesia:reset(),
    rabbit_mnesia:join_cluster(Node, disc),
    mnesia:start(),
    rabbit:start(),
    info("Cluster joined"),
  