anchor.diff:  	error_logger:error_report([mnesia:error_description(Reason), {error, Reason}]),
   	{error, Reason}.
   
  +-spec is_mod_auth_mnesia() -> boolean().
  +%% @doc Check if inets mod_auth uses mmnesia tables.
  +%% @hidden
  +is_mod_auth_mnesia() ->
  +	case application:get_env(inets, services) of
  +		{ok, InetsServices} ->
  +			is_mod_auth_mnesia1(InetsServices);
  +		undefined ->
  +			false
  +	end.
  +%% @hidden
  +is_mod_auth_mnesia1(InetsServices);
  +	case lists:keyfind(httpd, 1, InetsServices) of
  +		{httpd, HttpdInfo} ->
  +			F = fun({directory, _}) ->
  +						true;
  +					(_) ->
  +						false
  +			end,
  +			is_mod_auth_mnesia2(lists:filter(F, HttpdInfo));
  +		false ->
  +			ok
  +	end.
  +%% @hidden
  +is_mod_auth_mnesia2([{directory, {_Dir, []}} | T]) ->
  +	false;
  +is_mod_auth_mnesia2([{directory, {_, DirectoryInfo}} | _]) ->
  +	case lists:keyfind(auth_type, 1, DirectoryInfo) of
  +		{auth_type, mnesia} ->
  +			true;
  +		_ ->
  +			false
  +	end;
  +is_mod_auth_mnesia2([]) ->
  +	false.
  +
  
positive.code: %% @see //kernel/application:start/2
  %%
  start(normal = _StartType, _Args) ->
  	Tables = [client, service, offer, product, resource,
  			bucket, httpd_user, httpd_group, session, nrf_ref],
  	case mnesia:wait_for_tables(Tables, ?WAITFORTABLES) of
  		ok ->
  			start1();
  		{timeout, BadTabList} ->
  			case create_table(BadTabList) of
  				ok ->
  					case force(BadTabList) of
  						ok ->
  							start1();
  						{error, Reason} ->
  							error_logger:error_report(["ocs application failed to"
  									" start", {reason, Reason}, {module, ?MODULE}]),
  							{error, Reason}
  					end;
  				{error, Reason} ->
  					error_logger:error_report(["failed to create missing tables",
  							{reason, Reason}, {module, ?MODULE}]),
  					{error, Reason}
  			end;
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  start1() ->
  	case inets:services_info() of
  		ServicesInfo when is_list(ServicesInfo) ->
  			{ok, Profile} = application:get_env(hub_profile),
  			start2(Profile, ServicesInfo);
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  start2(Profile, [{httpc, _Pid, Info} | T]) ->
  	case proplists:lookup(profile, Info) of
  		{profile, Profile} ->
  			start3(Profile);
  		_ ->
  			start2(Profile, T)
  	end;
  start2(Profile, [_ | T]) ->
  	start2(Profile, T);
  start2(Profile, []) ->
  	case inets:start(httpc, [{profile, Profile}]) of
  		{ok, _Pid} ->
  			start3(Profile);
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  start3(Profile) ->
  	{ok, Options} = application:get_env(hub_options),
  	case httpc:set_options(Options, Profile) of
  		ok ->
  			start4();
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  start4() ->
  	case inets:services_info() of
  		ServicesInfo when is_list(ServicesInfo) ->
  			{ok, Profile} = application:get_env(nrf_profile),
  			start5(Profile, ServicesInfo);
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  start5(Profile, [{httpc, _Pid, Info} | T]) ->
  	case proplists:lookup(profile, Info) of
  		{profile, Profile} ->
  			start6(Profile);
  		_ ->
  			start5(Profile, T)
  	end;
  start5(Profile, [_ | T]) ->
  	start5(Profile, T);
  start5(Profile, []) ->
  	case inets:start(httpc, [{profile, Profile}]) of
  		{ok, _Pid} ->
  			start6(Profile);
  
negative.code: 			error_logger:info_msg("Loaded inets.~n"),
  			install12(Nodes, Acc);
  		{error, {already_loaded, inets}} ->
  			install12(Nodes, Acc);
  	end.
  %% @hidden
  install12(Nodes, Acc) ->
  	case is_mod_auth_mnesia() of
  		true ->
  			install13(Nodes, Acc);
  		false ->
  			error_logger:info_msg("Httpd service not defined. "
  					"User table not created~n"),
  			install15(Nodes, Acc)
  	end.
  %% @hidden
  install13(Nodes, Acc) ->
  	case create_table(httpd_user, Nodes) of
  		ok ->
  			install14(Nodes, [httpd_user | Acc]);
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  install14(Nodes, Acc) ->
  	case create_table(httpd_group, Nodes) of
  		ok ->
  			install15(Nodes, [httpd_group | Acc]);
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  install15(_Nodes, Tables) ->
  	case mnesia:wait_for_tables(Tables, ?WAITFORTABLES) of
  		ok ->
  			install16(Tables, lists:member(httpd_user, Tables));
  		{timeout, Tables} ->
  			error_logger:error_report(["Timeout waiting for tables",
  					{tables, Tables}]),
  