diff options
| author | Simon MacMullen <simon@lshift.net> | 2010-05-28 14:25:05 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@lshift.net> | 2010-05-28 14:25:05 +0100 |
| commit | 4c035fae81a0d07529c8c18c115bfdcf02ef8514 (patch) | |
| tree | 2e2d42b94d9c8a0a11455c40e63fb366b1f9b177 /src/rabbit.erl | |
| parent | f5bb52f0b28e7c628290e7596ea866c0dcc2f8aa (diff) | |
| parent | ab9024d762cfc1eb3da82d0a0293cbfd69d2bfea (diff) | |
| download | rabbitmq-server-git-4c035fae81a0d07529c8c18c115bfdcf02ef8514.tar.gz | |
Merge default into amqp_0_9_1.
Diffstat (limited to 'src/rabbit.erl')
| -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 525558d88f..09a190148f 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). |
