diff options
| author | Diana Corbacho <diana@rabbitmq.com> | 2017-02-27 16:24:21 +0000 |
|---|---|---|
| committer | Diana Corbacho <diana@rabbitmq.com> | 2017-02-27 16:24:21 +0000 |
| commit | ec2042877b50a88a87505b8eff486b8c23802412 (patch) | |
| tree | 5ca99404d025d2ae1f8487556bf0d58c61da2522 /src | |
| parent | 74eace424e303ad452cda41a703d2f62426348f6 (diff) | |
| download | rabbitmq-server-git-ec2042877b50a88a87505b8eff486b8c23802412.tar.gz | |
Rename function
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 2 | ||||
| -rw-r--r-- | src/rabbit_plugins.erl | 18 | ||||
| -rw-r--r-- | src/rabbit_plugins_main.erl | 18 |
3 files changed, 19 insertions, 19 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index b8e608aa51..e5ae855982 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -327,7 +327,7 @@ broker_start() -> ToBeLoaded = Plugins ++ ?APPS, start_apps(ToBeLoaded), maybe_sd_notify(), - ok = log_broker_started(rabbit_plugins:strict_plugins(rabbit_plugins:active())). + ok = log_broker_started(rabbit_plugins:strictly_plugins(rabbit_plugins:active())). %% Try to send systemd ready notification if it makes sense in the %% current environment. standard_error is used intentionally in all diff --git a/src/rabbit_plugins.erl b/src/rabbit_plugins.erl index 465500e910..5640aa474f 100644 --- a/src/rabbit_plugins.erl +++ b/src/rabbit_plugins.erl @@ -22,7 +22,7 @@ -export([ensure/1]). -export([extract_schemas/1]). -export([validate_plugins/1, format_invalid_plugins/1]). --export([is_strict_plugin/1, strict_plugins/2, strict_plugins/1]). +-export([is_strictly_plugin/1, strictly_plugins/2, strictly_plugins/1]). % Export for testing purpose. -export([is_version_supported/2, validate_plugins/2]). @@ -38,9 +38,9 @@ -spec dependencies(boolean(), [plugin_name()], [#plugin{}]) -> [plugin_name()]. -spec ensure(string()) -> {'ok', [atom()], [atom()]} | {error, any()}. --spec strict_plugins([plugin_name()], [#plugin{}]) -> [plugin_name()]. --spec strict_plugins([plugin_name()]) -> [plugin_name()]. --spec is_strict_plugin(#plugin{}) -> boolean(). +-spec strictly_plugins([plugin_name()], [#plugin{}]) -> [plugin_name()]. +-spec strictly_plugins([plugin_name()]) -> [plugin_name()]. +-spec is_strictly_plugin(#plugin{}) -> boolean(). %%---------------------------------------------------------------------------- @@ -179,21 +179,21 @@ dependencies(Reverse, Sources, AllPlugins) -> OrderedDests. %% Filter real plugins from application dependencies -is_strict_plugin(#plugin{extra_dependencies = ExtraDeps}) -> +is_strictly_plugin(#plugin{extra_dependencies = ExtraDeps}) -> lists:member(rabbit, ExtraDeps). -strict_plugins(Plugins, AllPlugins) -> +strictly_plugins(Plugins, AllPlugins) -> lists:filter( fun(Name) -> - is_strict_plugin(lists:keyfind(Name, #plugin.name, AllPlugins)) + is_strictly_plugin(lists:keyfind(Name, #plugin.name, AllPlugins)) end, Plugins). -strict_plugins(Plugins) -> +strictly_plugins(Plugins) -> {ok, ExpandDir} = application:get_env(rabbit, plugins_expand_dir), AllPlugins = list(ExpandDir), lists:filter( fun(Name) -> - is_strict_plugin(lists:keyfind(Name, #plugin.name, AllPlugins)) + is_strictly_plugin(lists:keyfind(Name, #plugin.name, AllPlugins)) end, Plugins). %% For a few known cases, an externally provided plugin can be trusted. diff --git a/src/rabbit_plugins_main.erl b/src/rabbit_plugins_main.erl index d4dd37668c..2be58f1e85 100644 --- a/src/rabbit_plugins_main.erl +++ b/src/rabbit_plugins_main.erl @@ -102,10 +102,10 @@ action(enable, Node, ToEnable0, Opts, State = #cli{all = All, rabbit_plugins:format_invalid_plugins(Invalid)}) end, NewImplicit = write_enabled_plugins(NewEnabled, State), - case rabbit_plugins:strict_plugins(NewEnabled -- Implicit, All) of + case rabbit_plugins:strictly_plugins(NewEnabled -- Implicit, All) of [] -> io:format("Plugin configuration unchanged.~n"); _ -> print_list("The following plugins have been enabled:", - rabbit_plugins:strict_plugins(NewImplicit -- Implicit, All)) + rabbit_plugins:strictly_plugins(NewImplicit -- Implicit, All)) end, action_change(Opts, Node, Implicit, NewImplicit, State); @@ -124,7 +124,7 @@ action(set, Node, NewEnabled0, Opts, State = #cli{all = All, rabbit_plugins:format_invalid_plugins(Invalid)}) end, NewImplicit = write_enabled_plugins(NewEnabled, State), - case rabbit_plugins:strict_plugins(NewImplicit, All) of + case rabbit_plugins:strictly_plugins(NewImplicit, All) of [] -> io:format("All plugins are now disabled.~n"); Plugins -> print_list("The following plugins are now enabled:", Plugins) @@ -151,7 +151,7 @@ action(disable, Node, ToDisable0, Opts, State = #cli{all = All, case length(Enabled) =:= length(NewEnabled) of true -> io:format("Plugin configuration unchanged.~n"); false -> print_list("The following plugins have been disabled:", - rabbit_plugins:strict_plugins(Implicit -- NewImplicit, + rabbit_plugins:strictly_plugins(Implicit -- NewImplicit, All)) end, action_change(Opts, Node, Implicit, NewImplicit, State); @@ -205,7 +205,7 @@ format_plugins(Node, Pattern, Opts, #cli{all = All, lists:member(Name,EnabledImplicitly); true -> true end, - rabbit_plugins:is_strict_plugin(Plugin)], + rabbit_plugins:is_strictly_plugin(Plugin)], Plugins1 = usort_plugins(Plugins), MaxWidth = lists:max([length(atom_to_list(Name)) || #plugin{name = Name} <- Plugins1] ++ [0]), @@ -305,14 +305,14 @@ rpc_call(Node, Online, Mod, Fun, Args, All) -> {ok, [], []} -> io:format(" nothing to do.~n", []); {ok, Start0, []} -> - Start = rabbit_plugins:strict_plugins(Start0, All), + Start = rabbit_plugins:strictly_plugins(Start0, All), io:format(" started ~b plugin~s.~n", [length(Start), plur(Start)]); {ok, [], Stop0} -> - Stop = rabbit_plugins:strict_plugins(Stop0, All), + Stop = rabbit_plugins:strictly_plugins(Stop0, All), io:format(" stopped ~b plugin~s.~n", [length(Stop), plur(Stop)]); {ok, Start0, Stop0} -> - Start = rabbit_plugins:strict_plugins(Start0, All), - Stop = rabbit_plugins:strict_plugins(Stop0, All), + Start = rabbit_plugins:strictly_plugins(Start0, All), + Stop = rabbit_plugins:strictly_plugins(Stop0, All), io:format(" stopped ~b plugin~s and started ~b plugin~s.~n", [length(Stop), plur(Stop), length(Start), plur(Start)]); {badrpc, nodedown} = Error -> |
