diff options
| author | David Wragg <dpw@lshift.net> | 2010-05-16 17:40:52 +0100 |
|---|---|---|
| committer | David Wragg <dpw@lshift.net> | 2010-05-16 17:40:52 +0100 |
| commit | 6b56c4a54c57f15b01fc6f8c4b65eabdd80f7c23 (patch) | |
| tree | 97ddace62175e35c21b0b0091ebd186820feba8e | |
| parent | 9a57aebae7c66aa8c23537c0735e203e55f4efa2 (diff) | |
| parent | b11a85c434ce1b9923f6e03ac32977e3a1bd5875 (diff) | |
| download | rabbitmq-server-git-6b56c4a54c57f15b01fc6f8c4b65eabdd80f7c23.tar.gz | |
Merge bug22763 into default
| -rw-r--r-- | src/rabbit.erl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 67f8df947b..c389178a0e 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -299,6 +299,18 @@ run_boot_step({StepName, Attributes}) -> ok end. +module_attributes(Module) -> + case catch Module:module_info(attributes) of + {'EXIT', {undef, [{Module, module_info, _} | _]}} -> + io:format("WARNING: module ~p not found, so not scanned for boot steps.~n", + [Module]), + []; + {'EXIT', Reason} -> + exit(Reason); + V -> + V + end. + boot_steps() -> AllApps = [App || {App, _, _} <- application:loaded_applications()], Modules = lists:usort( @@ -310,7 +322,7 @@ boot_steps() -> lists:flatmap(fun (Module) -> [{StepName, Attributes} || {rabbit_boot_step, [{StepName, Attributes}]} - <- Module:module_info(attributes)] + <- module_attributes(Module)] end, Modules), sort_boot_steps(UnsortedSteps). |
