aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2014-09-09 14:53:06 +0200
committerRaimo Niskanen <[email protected]>2014-09-09 14:53:06 +0200
commitf1ec7172f48f16e399ae07db2260195432661d07 (patch)
tree36bef97c09c2ffecb4cbb2ca7a15705b1aef0398 /lib
parent8154921f48ad207ac292e83b9dade49ad0235e97 (diff)
downloadotp-f1ec7172f48f16e399ae07db2260195432661d07.tar.gz
otp-f1ec7172f48f16e399ae07db2260195432661d07.tar.bz2
otp-f1ec7172f48f16e399ae07db2260195432661d07.zip
Fix manager backwards compat for agent addr
Diffstat (limited to 'lib')
-rw-r--r--lib/snmp/src/manager/snmpm_config.erl25
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/snmp/src/manager/snmpm_config.erl b/lib/snmp/src/manager/snmpm_config.erl
index 940800fed4..24adb8a47f 100644
--- a/lib/snmp/src/manager/snmpm_config.erl
+++ b/lib/snmp/src/manager/snmpm_config.erl
@@ -442,8 +442,31 @@ agent_info(TargetName, all) ->
All ->
{ok, [{Item, Val} || {{_, Item}, Val} <- All]}
end;
+%% Begin backwards compatibility
+agent_info(TargetName, address) ->
+ case agent_info({TargetName, taddress}) of
+ {ok, Val} ->
+ {Addr, _} = Val,
+ {ok, Addr};
+ _ ->
+ %% This should be redundant since 'taddress' should exist
+ agent_info({TargetName, address})
+ end;
+agent_info(TargetName, port) ->
+ case agent_info({TargetName, taddress}) of
+ {ok, Val} ->
+ {_, Port} = Val,
+ {ok, Port};
+ _ ->
+ %% This should be redundant since 'taddress' should exist
+ agent_info({TargetName, port})
+ end;
+%% End backwards compatibility
agent_info(TargetName, Item) ->
- case ets:lookup(snmpm_agent_table, {TargetName, Item}) of
+ agent_info({TargetName, Item}).
+
+agent_info(Key) ->
+ case ets:lookup(snmpm_agent_table, Key) of
[{_, Val}] ->
{ok, Val};
[] ->