summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2020-06-09 17:19:34 +0200
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2020-06-09 17:19:34 +0200
commit03f1e7a0c1dde2e1395e941c912289b485f1b4a2 (patch)
tree7c99545f1ef4d1ce09a3de9c663a8c419dcd10df
parentdf1fffbfc5567ae947cb1b764b8958399bfa5cf8 (diff)
downloadrabbitmq-server-git-03f1e7a0c1dde2e1395e941c912289b485f1b4a2.tar.gz
rabbit_prelaunch_conf: Style fixes
Things like staying in the 80-column limit and spaces around '='.
-rw-r--r--apps/rabbitmq_prelaunch/src/rabbit_prelaunch_conf.erl35
1 files changed, 20 insertions, 15 deletions
diff --git a/apps/rabbitmq_prelaunch/src/rabbit_prelaunch_conf.erl b/apps/rabbitmq_prelaunch/src/rabbit_prelaunch_conf.erl
index d2409f0d0b..af7158830a 100644
--- a/apps/rabbitmq_prelaunch/src/rabbit_prelaunch_conf.erl
+++ b/apps/rabbitmq_prelaunch/src/rabbit_prelaunch_conf.erl
@@ -118,14 +118,14 @@ find_actual_main_config_file(#{main_config_file := File}) ->
case filelib:is_regular(NewFormatFile) of
true ->
rabbit_log_prelaunch:warning(
- "Both old (.config) and new (.conf) format config "
- "files exist."),
+ "Both old (.config) and new (.conf) format "
+ "config files exist."),
rabbit_log_prelaunch:warning(
"Using the old format config file: ~s",
[OldFormatFile]),
rabbit_log_prelaunch:warning(
- "Please update your config files to the new format "
- "and remove the old file."),
+ "Please update your config files to the new "
+ "format and remove the old file."),
ok;
false ->
ok
@@ -211,9 +211,12 @@ generate_config_from_cuttlefish_files(Context,
rabbit_log_prelaunch:error("Error parsing configuration:"),
lists:foreach(
fun(Error) ->
- rabbit_log_prelaunch:error(" - ~ts", [cuttlefish_error:xlate(Error)])
+ rabbit_log_prelaunch:error(
+ " - ~ts",
+ [cuttlefish_error:xlate(Error)])
end, Errors),
- rabbit_log_prelaunch:error("Are these files using the Cuttlefish format?"),
+ rabbit_log_prelaunch:error(
+ "Are these files using the Cuttlefish format?"),
throw({error, failed_to_parse_configuration_file});
Config0 ->
%% Finalize configuration, based on the schema.
@@ -361,17 +364,16 @@ apply_erlang_term_based_config([]) ->
ok.
apply_app_env_vars(App, [{Var, Value} | Rest]) ->
- rabbit_log_prelaunch:debug(
- " - ~s = ~p",
- [Var, Value]),
+ rabbit_log_prelaunch:debug(" - ~s = ~p", [Var, Value]),
ok = application:set_env(App, Var, Value, [{persistent, true}]),
apply_app_env_vars(App, Rest);
apply_app_env_vars(_, []) ->
ok.
set_credentials_obfuscation_secret() ->
- rabbit_log_prelaunch:debug("Refreshing credentials obfuscation configuration from env: ~p",
- [application:get_all_env(credentials_obfuscation)]),
+ rabbit_log_prelaunch:debug(
+ "Refreshing credentials obfuscation configuration from env: ~p",
+ [application:get_all_env(credentials_obfuscation)]),
ok = credentials_obfuscation:refresh_config(),
CookieBin = rabbit_data_coercion:to_binary(erlang:get_cookie()),
rabbit_log_prelaunch:debug(
@@ -415,9 +417,11 @@ decrypt_app(App, [{Key, Value} | Tail], Algo) ->
end,
decrypt_app(App, Tail, Algo2).
-decrypt({encrypted, _}=EncValue, {Cipher, Hash, Iterations, PassPhrase} = Algo) ->
- {rabbit_pbe:decrypt_term(Cipher, Hash, Iterations, PassPhrase, EncValue), Algo};
-decrypt({encrypted, _}=EncValue,
+decrypt({encrypted, _} = EncValue,
+ {Cipher, Hash, Iterations, PassPhrase} = Algo) ->
+ {rabbit_pbe:decrypt_term(Cipher, Hash, Iterations, PassPhrase, EncValue),
+ Algo};
+decrypt({encrypted, _} = EncValue,
ConfigEntryDecoder)
when is_list(ConfigEntryDecoder) ->
Algo = config_entry_decoder_to_algo(ConfigEntryDecoder),
@@ -451,7 +455,8 @@ config_entry_decoder_to_algo(ConfigEntryDecoder) ->
proplists:get_value(
hash, ConfigEntryDecoder, rabbit_pbe:default_hash()),
proplists:get_value(
- iterations, ConfigEntryDecoder, rabbit_pbe:default_iterations()),
+ iterations, ConfigEntryDecoder,
+ rabbit_pbe:default_iterations()),
PassPhrase
}
end.