BgpConfig code is too aggressive in treating nodes as deleted.

BgpPeers sometimes do not come up when repeatedly doing delete
and add in the bgp_stress_test via [DELETE|ADD]_BGP_PEER events.

Root cause is that the config code does not look at IFMap nodes
that have no neighbors in the graph i.e. it considers them to
be deleted.  This can cause a problem if a bgp-router node is
added and processed before parent link to the routing-instance
has been processed.  In this case, the BgpProtocolConfig that
corresponds to the bgp-router is not created.

Fix is to not consider IFMap nodes without neighbors as deleted.

Also fix minor issue wherein the creation of a BgpPeeringConfig
would get logged as a create and an update.

Change-Id: I44c1d6de17a7a495cc18a5ddd20a05dde8b8b3fb
Set the ip_address_mode according to scale out configuration. This is done to support ECMP with allowed address pair changes

Change-Id: I3574b157398eb47d028f4e0f11b884b6ea15ca4d
http: HttpClient: add ClearCallback()

Added to prevent HttpClient from calling a registered callback method. Useful
ie. when you'd like to abandon the request.

Change-Id: If5a8147f155b704515ea6b052100da2e54e331d8
Signed-off-by: Bartlomiej Wolowiec <bartlomiej.wolowiec@codilime.com>
Signed-off-by: Mateusz Zalega <mateusz.zalega@codilime.com>
Report traceback with details only in the case where unexpected exception occurs in api-server
(i.e ignore reporting tracebacks details for bottle.abort). Add unit test for same.

Fixes bug: 1346459

Change-Id: I5dbb2387d4046210958191845f2a66675284ad55
return subnet dict to plugin as per neutron compatibility spec

Change-Id: Ib5f8492912e46f0589828f7eba5761c09f91043b
Add notes on agent and vxlan_agent

Change-Id: I4aa2a670d07aa07149199a9edcf6fa4c1bbb84dd
Fix race condition in TcpSession::CloseInternal method.

It's possible that calling the EventObserver for a TcpSession causes
another thread to call TcpServer::DeleteSession for the TcpSession in
question. The existing code already protects against deletion of the
TcpSession this by taking a reference on it via an intrusive pointer.

It's also possible that the TcpServer itself gets deleted via another
thread as an indirect result of calling the EventObserver.  If this
happens before the call to the OnSessionClose has been completed, we
end up accessing freed memory and crash.

This problem happens occasionally when running bgp_peer_close_test as
the XmppClient Shutdown happens around the same time that the client
received a TcpClose due to Shutdown on the XmppServer side.

Fix is to use a intrusive back pointer (TcpServerPtr) in TcpSession.

Change-Id: I5fbb00a76a333f6b1dea2e19c2c1c1e3cd2079d4
Orderly deletion of Xmpp objects in Agent while applying newly learnt
services via discovery.

A new set of services learnt via discovery with the present services
DOWN should result in orderly cleanup of Xmpp objects. Now we trigger
a managed delete of XmppClient object which will internally
delete the XmppClientConnection and XmppChannel object.

o Need to explicitly delete AgentXmppChannel, AgentIfmapXmppChannel,
  AgentDnsXmppChannel, XmppInit
o Note we reset XmppClient object from agent data-structure but
  the actual object can get deleted at a later time as part of
  the Managed Delete.
o Apply newly learnt services from discovery while the older
  objects are being deleted.

Xmpp Library Changes (Nischal Seth)
===================================
o Fix bug that may cause premature delete of XmppClientConection.
o XmppClientConnection::DeleteActor's MayDelete method should not
  return true if the XmppClient has no registered event handlers.
  It should only look at XmppClientConnection's receiver count.

      The above change uncovered a bug in NetworkAgentMock wherein the
  AgentPeer constructor registered for xmps::CONFIG on the channel but
  never unregistered.
o Add methods to XmppServerConnection and XmppClientConnection to
  return pointers to XmppServer/XmppClient as appropriate to avoid
  static_cast all over the place.

Change-Id: I1018b03b4f9124955b2be8cd0a851f0edd72030a
mockcassandra should download cassandra binary to /tmp/cache/[USER]/systemless_test instead of /tmp

Change-Id: I121d60b226309e5866925b99a6d8c04db08f5c14
Fix concurrency issue for the SNAT

Change-Id: I8e28527de44453732129c03d939d4988f2161c3a
Remove lock from metadata proxy, avoid deadlock in agent

Change-Id: Ib6e0a598d95ba2c3250c2d533d0d92e0c96037e8
[Schema transformer] Clear logging on IF-MAP

On each IF-MAP events/notifications, the schema raise a log.
That patch only raise a log if a schema's method is calling when an
IF-MAP event occurred.

Change-Id: Ib2f0596679f50a6a5efaa0a3afd34239693a48ea
[Schema transformer] Catch NoIdError exception

Change-Id: I6b0a417b3adf6372f86b9a851d60966f9a1d1a28
support for flow drop and short flow reason.

Change-Id: I94933d1fc6da9e30975882f3d458c8ebcb0f5529
Bug 1348139: Change CONNECTING to SUSPENDED

Change-Id: I49c2cd5baa6a82c7d6c2c19a979cbc33bfe41bca
closes-Bug: 1348139
check for presence of dns_nameservers and host_routes in subnet_q

Change-Id: I8238e35b7c36913f32766b21904a4489ce222b2c
Fix corner case in TcpServer accept handler.

If the TcpServer accept handler gets called after the the server
has been shut down i.e. acceptor_ is NULL, it sets session state
to established and then allows the newly allocated session to get
destroyed when the scoped pointer is destroyed.  This causes the
assertion in ~TcpSession on !established to fail.

Fix is to check if acceptor is NULL before marking the session as
established.

Change-Id: Iffa2dd96769100a77162ed771d66ca975eecdfb5
Set security group based on virtual networks for in-network
service instance VMIs.

Change-Id: Idf1c1b216e12b5e8f41f1e7722f5792f1d1af179
Closes-Bug: 1348831
Fix concurrency issue in processing passive BgpSessions.

The code in BgpSessionManager::AcceptSession is called from the IO
thread. It acessses RoutingInstances and BgpPeers to determine if
we have a configured BgpPeer corresponding to the session. This is
clearly a problem since the RoutingInstance and BgpPeer maps are
modified from the bgp::Config task which is not exclusive with the
IO thread.

Fix is to have BgpSessionManager::AcceptSession queue the session
and process it from the context of the bgp::Config task.

Also tweak a couple of tests to check error counts for received open
messages instead of notifications that are sent in respose to those
errors and received on the other side.

Change-Id: I5a17ecc34f2e36f914cffda259af3957f527a8d6
Merge "[Schema transformer] Clear logging on IF-MAP"