aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmp_standard_mib.erl
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2014-04-09 10:29:00 +0200
committerRaimo Niskanen <[email protected]>2014-07-22 09:59:15 +0200
commit768a6d38597b8bedf6551ad2e6472b2965765dd2 (patch)
treee4eb4fb767d2c83954bdf63f1191497589e267b9 /lib/snmp/src/agent/snmp_standard_mib.erl
parent934b6de4d2ab6c31c5217e1ba4779ade9e37cc83 (diff)
downloadotp-768a6d38597b8bedf6551ad2e6472b2965765dd2.tar.gz
otp-768a6d38597b8bedf6551ad2e6472b2965765dd2.tar.bz2
otp-768a6d38597b8bedf6551ad2e6472b2965765dd2.zip
Rewrite agent configuration parsing
Diffstat (limited to 'lib/snmp/src/agent/snmp_standard_mib.erl')
-rw-r--r--lib/snmp/src/agent/snmp_standard_mib.erl23
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/snmp/src/agent/snmp_standard_mib.erl b/lib/snmp/src/agent/snmp_standard_mib.erl
index 766b75022b..aace3fd413 100644
--- a/lib/snmp/src/agent/snmp_standard_mib.erl
+++ b/lib/snmp/src/agent/snmp_standard_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -152,16 +152,19 @@ do_reconfigure(Dir) ->
%%-----------------------------------------------------------------
read_standard(Dir) ->
?vdebug("check standard config file",[]),
- FileName = "standard.conf",
- Gen = fun(D, Reason) ->
- throw({error, {failed_reading_config_file,
- D, FileName,
- list_dir(Dir), Reason}})
- end,
- Filter = fun(Standard) -> sort_standard(Standard) end,
- Check = fun(Entry) -> check_standard(Entry) end,
+ FileName = "standard.conf",
+ Gen =
+ fun (D, Reason) ->
+ throw(
+ {error,
+ {failed_reading_config_file,
+ D, FileName, list_dir(Dir), Reason}})
+ end,
+ Order = fun snmp_conf:no_order/2,
+ Check = fun (Entry, State) -> {check_standard(Entry), State} end,
+ Filter = fun sort_standard/1,
[Standard] =
- snmp_conf:read_files(Dir, [{Gen, Filter, Check, FileName}]),
+ snmp_conf:read_files(Dir, [{FileName, Gen, Order, Check, Filter}]),
Standard.
list_dir(Dir) ->