anchor.diff:    case Module:nodelist() of
       {ok, Nodes} ->
         case lists:member(node(), Nodes) of
  -        true  -> ok;
  +        true  -> {ok, Nodes};
           false ->
             autocluster_log:info("Registering node with ~p", [Name]),
             case Module:register() of
               ok ->
                 autocluster_log:debug("Registered node"),
  -              ok;
  +              {ok, Nodes};
               {error, Reason} ->
                 autocluster_log:error("Error registering node with ~p: ~p", [Name, Reason]),
                 error
  
positive.code: %% @doc Check to see if the node is already defined in a cluster, joining if required
  %% @end
  %%
  ensure_clustered() ->
    Nodes = rabbit_mnesia:cluster_nodes(all),
    case Nodes of
      [] ->
        autocluster_log:info("Appears to be first node"),
        ok;
      _  ->
        case lists:member(node(), Nodes) of
          true  -> ok;
          false -> join_cluster(Nodes)
        end
    end.
  
negative.code: %% @end
  %%
  join_cluster(Nodes) ->
    case filter_dead_nodes(Nodes) of
      [] ->
        autocluster_log:warning("Can not communicate with cluster nodes: ~p",
          [Nodes]),
        ok;
      Alive ->
        autocluster_log:debug("Joining existing cluster: ~p", [Alive]),
        application:stop(rabbit),
        mnesia:stop(),
        rabbit_mnesia:reset(),
        rabbit_mnesia:join_cluster(lists:nth(1, Alive),
                                   autocluster_config:get(node_type)),
        mnesia:start(),
        rabbit:start(),
        autocluster_log:debug("Cluster joined"),
        ok
    end.
  