Discussion:
[erlang-patches] Patch for bug in snmp_test_manager.erl
unknown
2014-04-11 13:09:23 UTC
Permalink
Hi,

Recently I was familiarizing myself with the SNMP functionality of
Erlang and decided to use the snmp_test_manager
(lib/snmp/test/snmp_test_manager.erl) setup as a guide. During my endeavor
I was unable to start_link an snmp_test_manager due to a badmatch occurring
on line 133. See traceback here: http://pastebin.com/1eNYkGTz

This is because on line 133 the snmp_test_manager module is expecting a
tuple of {ok, Pid} from snmpm:start_link/0 . However, snmpm:start_link/0
will only return the atom ok. This causes a badmatch. By editing line 133
of snmp_test_manager.erl to only expect the atom ok, and editing line 136
to not reference the no longer existing Pid variable, I was able to fix the
module. I also edited line 59 to remove the mgr key from the State record,
as after these changes it was no longer being used. You can find my public
repository here:

https://github.com/telsacolton/otp

and the branch with the fix is called
snmp_test_manager_badmatch_pid<https://github.com/telsacolton/otp/tree/snmp_test_manager_badmatch_pid>
--
Colton Leekley-Winslow
Developer, Telsasoft
(952) 707-8581
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20140411/8a1d5921/attachment.html>
unknown
2014-04-15 14:32:12 UTC
Permalink
Thank you for your contribution! However, before we continue working with
this patch, please provide a better commit message, according to the
following guidelines for "Writing good commit messages [1].

[1] https://github.com/erlang/otp/wiki/Writing-good-commit-messages

Andreas Schumacher, Erlang/OTP, Ericsson AB


*From:* erlang-patches-bounces [mailto:
erlang-patches-bounces] *On Behalf Of *Colton Leekley-Winslow
*Sent:* den 11 april 2014 15:09
*To:* erlang-patches
*Subject:* [erlang-patches] Patch for bug in snmp_test_manager.erl



Hi,



Recently I was familiarizing myself with the SNMP functionality of
Erlang and decided to use the snmp_test_manager
(lib/snmp/test/snmp_test_manager.erl) setup as a guide. During my endeavor
I was unable to start_link an snmp_test_manager due to a badmatch occurring
on line 133. See traceback here: http://pastebin.com/1eNYkGTz



This is because on line 133 the snmp_test_manager module is expecting a
tuple of {ok, Pid} from snmpm:start_link/0 . However, snmpm:start_link/0
will only return the atom ok. This causes a badmatch. By editing line 133
of snmp_test_manager.erl to only expect the atom ok, and editing line 136
to not reference the no longer existing Pid variable, I was able to fix the
module. I also edited line 59 to remove the mgr key from the State record,
as after these changes it was no longer being used. You can find my public
repository here:



https://github.com/telsacolton/otp



and the branch with the fix is called
snmp_test_manager_badmatch_pid<https://github.com/telsacolton/otp/tree/snmp_test_manager_badmatch_pid>
--
Colton Leekley-Winslow

Developer, Telsasoft

(952) 707-8581
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20140415/320aabda/attachment.html>
unknown
2014-04-15 15:15:58 UTC
Permalink
Hi Andreas,

Ahh sorry about that. I've amended my commit message, which is commit
hash eadc39c5356692d8a093b835d884c8e11faf4c73 .
Post by unknown
Thank you for your contribution! However, before we continue working with
this patch, please provide a better commit message, according to the
following guidelines for "Writing good commit messages [1].
[1] https://github.com/erlang/otp/wiki/Writing-good-commit-messages
Andreas Schumacher, Erlang/OTP, Ericsson AB
erlang-patches-bounces] *On Behalf Of *Colton Leekley-Winslow
*Sent:* den 11 april 2014 15:09
*To:* erlang-patches
*Subject:* [erlang-patches] Patch for bug in snmp_test_manager.erl
Hi,
Recently I was familiarizing myself with the SNMP functionality of
Erlang and decided to use the snmp_test_manager
(lib/snmp/test/snmp_test_manager.erl) setup as a guide. During my endeavor
I was unable to start_link an snmp_test_manager due to a badmatch occurring
on line 133. See traceback here: http://pastebin.com/1eNYkGTz
This is because on line 133 the snmp_test_manager module is expecting a
tuple of {ok, Pid} from snmpm:start_link/0 . However, snmpm:start_link/0
will only return the atom ok. This causes a badmatch. By editing line 133
of snmp_test_manager.erl to only expect the atom ok, and editing line 136
to not reference the no longer existing Pid variable, I was able to fix the
module. I also edited line 59 to remove the mgr key from the State record,
as after these changes it was no longer being used. You can find my public
https://github.com/telsacolton/otp
and the branch with the fix is called
snmp_test_manager_badmatch_pid<https://github.com/telsacolton/otp/tree/snmp_test_manager_badmatch_pid>
--
Colton Leekley-Winslow
Developer, Telsasoft
(952) 707-8581
--
Colton Leekley-Winslow
Developer, Telsasoft
(952) 707-8581
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20140415/615a890a/attachment.html>
Loading...