anchor.diff:      {ok, Body} ->
         lists:flatten(Body);
       {error, Error} ->
  -      error_logger:error_msg("Could not JSON serialize the request body: ~p (~p)~n", [Error, Payload]),
  -      rabbit:stop_and_halt()
  -  end.
  -
  -
  -%% @private
  -%% @spec build_registration_body(Service, Name, Port) -> list()
  -%% @where Service = list(), Name = list()|undefined, Port = list()|undefined
  -%% @doc Return a property list with the payload data structure for registration
  -%% @end
  -%%
  -build_registration_body(Service, undefined, undefined, _) ->
  -  [{"ID", Service}, {"Name", Service}];
  -build_registration_body(Service, Name, undefined, _) ->
  -  [{"ID", Service}, {"Name", Service}, {"Tags", [list_to_atom(Name)]}];
  -build_registration_body(Service, undefined, Port, TTL) ->
  -  [{"ID", Service}, {"Name", Service}, {"Port", Port}, {"Check", [{"Notes", ?NOTES}, {"TTL", ttl_string(TTL)}]}];
  -build_registration_body(Service, Name, Port, TTL) ->
  -  [{"ID", Service}, {"Name", Service}, {"Port", Port}, {"Tags", [list_to_atom(Name)]}, {"Check", [{"Notes", ?NOTES}, {"TTL", ttl_string(TTL)}]}].
  -
  -
  -%% @private
  -%% @spec host_sname(binary()) -> list()
  -%% @doc Return the hostname/sname from the specified value
  -%% @end
  -%%
  -host_sname(Value) ->
  -  Parts = string:tokens(binary_to_list(Value), "."),
  -  case length(Parts) of
  -    1 -> Value;
  -    _ -> lists:nth(1, Parts)
  +      err("Could not JSON serialize the request body: ~p (~p)~n", [Error, Payload]),
  +      {error, Error}
     end.
   
   
  
positive.code: %% @end
  %%
  shutdown() ->
    io:format("~n              Consul Cluster Deregistering: "),
    case deregister() of
      ok ->
        io:format("Node deregistered~n");
      Other ->
        io:format("Error deregistering: ~p~n", [Other])
    end,
    ok.
  
  
  %% @private
  %% @spec extract_nodes() -> list()
  %% @doc Fetch the list of cluster nodes from Consul, returning them as a list of
  %%      atoms.
  %% @end
  
negative.code:   end,
    case autocluster_consul_client:get(Path, Args) of
      {ok, Nodes} -> extract_nodes(Nodes);
      {error, Error} ->
        warning("Error fetching nodes from consul: ~p~n", [Error]),
        []
    end.
  
  
  