From eadc39c5356692d8a093b835d884c8e11faf4c73 Mon Sep 17 00:00:00 2001 From: Colton Date: Fri, 11 Apr 2014 07:56:41 -0500 Subject: Fix badmatch error when trying to start_link an snmp_test_manager Was previously unable to start_link an snmp_test_manager due to a badmatch occurring on line 133. See traceback here: http://pastebin.com/1eNYkGTz Edit snmp_test_manager.erl to only expect the atom ok when it was in turn start_linking an snmpm server. Also remove reference to no longer existing Pid variable. Lastly remove the mgr key from the State record, as after these changes it was no longer being used. --- lib/snmp/test/snmp_test_manager.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/snmp/test/snmp_test_manager.erl b/lib/snmp/test/snmp_test_manager.erl index 925ae77ab5..6d8673eecd 100644 --- a/lib/snmp/test/snmp_test_manager.erl +++ b/lib/snmp/test/snmp_test_manager.erl @@ -56,7 +56,7 @@ -export([init/1, handle_call/3, handle_cast/2, handle_info/2, code_change/3, terminate/2]). --record(state, {mgr, parent, req, agent_target_name}). +-record(state, {parent, req, agent_target_name}). -define(SERVER, ?MODULE). -define(USER, ?MODULE). @@ -130,10 +130,10 @@ init([Parent, Opts]) -> do_init(Opts) -> {MgrDir, MgrConf, MgrOpts, AgentTargetName, AgentConf} = parse_opts(Opts), ok = snmp_config:write_manager_config(MgrDir, "", MgrConf), - {ok, Pid} = snmpm:start_link(MgrOpts), + ok = snmpm:start_link(MgrOpts), ok = snmpm:register_user(?USER, ?MODULE, self()), ok = snmpm:register_agent(?USER, AgentTargetName, AgentConf), - {ok, #state{mgr = Pid, agent_target_name = AgentTargetName}}. + {ok, #state{agent_target_name = AgentTargetName}}. parse_opts(Opts) -> -- cgit v1.2.3