aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmpa_conf.erl
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2014-08-22 12:09:03 +0200
committerRaimo Niskanen <[email protected]>2014-08-22 12:09:03 +0200
commitbdbd6849aa811faf20d5ce7d577a49612266209a (patch)
treedad16dd76eebe0b8a0d2fe5fbff0f9040ffd7db0 /lib/snmp/src/agent/snmpa_conf.erl
parent037590364fe8b5a657563cd7d28a20d84ee8d99f (diff)
downloadotp-bdbd6849aa811faf20d5ce7d577a49612266209a.tar.gz
otp-bdbd6849aa811faf20d5ce7d577a49612266209a.tar.bz2
otp-bdbd6849aa811faf20d5ce7d577a49612266209a.zip
Clean up config error handling and negative results
Diffstat (limited to 'lib/snmp/src/agent/snmpa_conf.erl')
-rw-r--r--lib/snmp/src/agent/snmpa_conf.erl23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/snmp/src/agent/snmpa_conf.erl b/lib/snmp/src/agent/snmpa_conf.erl
index b4d32dc928..fe3f63c4ca 100644
--- a/lib/snmp/src/agent/snmpa_conf.erl
+++ b/lib/snmp/src/agent/snmpa_conf.erl
@@ -475,6 +475,16 @@ write_target_addr_conf(Fd, Conf) ->
do_write_target_addr_conf(
Fd,
+ {Name, Domain, Address, Timeout, RetryCount, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize})
+ when is_atom(Domain) ->
+ io:format(
+ Fd,
+ "{\"~s\", ~w, ~w, ~w, ~w, \"~s\", \"~s\", \"~s\", ~w, ~w}.~n",
+ [Name, Domain, Address, Timeout, RetryCount, TagList,
+ ParamsName, EngineId, TMask, MaxMessageSize]);
+do_write_target_addr_conf(
+ Fd,
{Name, Ip, Udp, Timeout, RetryCount, TagList,
ParamsName, EngineId, TMask, MaxMessageSize})
when is_integer(Udp) ->
@@ -485,15 +495,10 @@ do_write_target_addr_conf(
{Name, Domain, Address, Timeout, RetryCount, TagList,
ParamsName, EngineId, TMask, MaxMessageSize});
do_write_target_addr_conf(
- Fd,
- {Name, Domain, Address, Timeout, RetryCount, TagList,
- ParamsName, EngineId, TMask, MaxMessageSize})
- when is_atom(Domain) ->
- io:format(
- Fd,
- "{\"~s\", ~w, ~w, ~w, ~w, \"~s\", \"~s\", \"~s\", ~w, ~w}.~n",
- [Name, Domain, Address, Timeout, RetryCount, TagList,
- ParamsName, EngineId, TMask, MaxMessageSize]);
+ _Fd,
+ {_Name, Domain, Address, _Timeout, _RetryCount, _TagList,
+ _ParamsName, _EngineId, _TMask, _MaxMessageSize}) ->
+ error({bad_address, {Domain, Address}});
do_write_target_addr_conf(
Fd,
{Name, Domain, Ip, Udp, Timeout, RetryCount, TagList,