diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-06-11 12:50:32 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-06-11 12:50:32 +0100 |
| commit | 0e668a2af26824a4157cbe183b096f28385067ce (patch) | |
| tree | 3fb9ce9199a4473a6ca681cdbe6e548d47b50d52 /src | |
| parent | 1c0f232bf18b90d78bfc024bf9dca3432252082f (diff) | |
| download | rabbitmq-server-git-0e668a2af26824a4157cbe183b096f28385067ce.tar.gz | |
A few last clenaups
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 16 | ||||
| -rw-r--r-- | src/rabbit_version.erl | 7 |
2 files changed, 8 insertions, 15 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 9018161991..4901ea17ed 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -405,9 +405,7 @@ handle_app_error(Term) -> end. run_cleanup_steps(Apps) -> - [run_step(Name, Attributes, cleanup) || - {App, Name, Attributes} <- find_steps(Apps), - lists:member(App, Apps)], + [run_step(Name, Attrs, cleanup) || {_, Name, Attrs} <- find_steps(Apps)], ok. await_startup() -> @@ -525,16 +523,12 @@ run_boot_steps() -> run_boot_steps([App || {App, _, _} <- application:loaded_applications()]). run_boot_steps(Apps) -> - Steps = find_steps(Apps), - [ok = run_step(StepName, Attributes, mfa) || - {_, StepName, Attributes} <- Steps], + [ok = run_step(Step, Attrs, mfa) || {_, Step, Attrs} <- find_steps(Apps)], ok. -find_steps(BaseApps) -> - Apps = BaseApps -- [App || {App, _, _} <- rabbit_misc:which_applications()], - FullBoot = sort_boot_steps( - rabbit_misc:all_module_attributes(rabbit_boot_step)), - [Step || {App, _, _} = Step <- FullBoot, lists:member(App, Apps)]. +find_steps(Apps) -> + All = sort_boot_steps(rabbit_misc:all_module_attributes(rabbit_boot_step)), + [Step || {App, _, _} = Step <- All, lists:member(App, Apps)]. run_step(StepName, Attributes, AttributeName) -> case [MFA || {Key, MFA} <- Attributes, diff --git a/src/rabbit_version.erl b/src/rabbit_version.erl index ef480ccba6..3a041508c6 100644 --- a/src/rabbit_version.erl +++ b/src/rabbit_version.erl @@ -113,11 +113,10 @@ upgrades_required(Scope) -> %% ------------------------------------------------------------------- with_upgrade_graph(Fun, Scope) -> - Attrs = rabbit_misc:all_module_attributes(rabbit_upgrade), case rabbit_misc:build_acyclic_graph( - fun ({Module, Steps}) -> vertices(Module, Steps, Scope) end, - fun ({Module, Steps}) -> edges(Module, Steps, Scope) end, - [{Mod, Steps} || {_, Mod, Steps} <- Attrs]) of + fun ({_App, Module, Steps}) -> vertices(Module, Steps, Scope) end, + fun ({_App, Module, Steps}) -> edges(Module, Steps, Scope) end, + rabbit_misc:all_module_attributes(rabbit_upgrade)) of {ok, G} -> try Fun(G) after |
