Exa-Networks/exabgp — pull request #161 by dneiter (2014-08-23 02:08:19+00:00)
Title: Fix KeyError, when sending "down" neighbor-state message

If initial connection to bgp peer fails, json api raises KeyError exception, trying to write state message.
The reason: JSON.reset() is only called upon successful connection, and reset() is only function, which inserts peer into _counter dictionary.

Stack trace: https://gist.github.com/dneiter/a9d2542662e53203c511

The fix: let JSON.increment() insert peer into self._counter() dictionary, if necessary.