summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2010-05-18 15:22:36 +0100
committerMatthew Sackman <matthew@lshift.net>2010-05-18 15:22:36 +0100
commitd95c60baffae89d962f33fa0353e48261e6a229d (patch)
tree8294acf782d5803ad8cf14fdd453415a1f44853d /src
parentbe1e06df00b7cdd4b148557f77f4b93970137419 (diff)
parent6b56c4a54c57f15b01fc6f8c4b65eabdd80f7c23 (diff)
downloadrabbitmq-server-git-d95c60baffae89d962f33fa0353e48261e6a229d.tar.gz
Merging default into bug 21673
Diffstat (limited to 'src')
-rw-r--r--src/rabbit.erl14
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).