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
Remove print of tenant_name when not available

This patch removes the prin of the tenant_name
when it is not available which causes a
traceback.

Change-Id: I7f8923a1dbe986216be1cee43ade5e353efe6876
Closes-bug: #1346817
* Apply vrf translate rule on egress traffic also, so that RPF
  information is setup properly
* Test case for same

Change-Id: I0a0facff15f978c2499453c36dc758237fe8c35a
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>
When the collector service is restarted, contrail-analytics.rules takes care of flushing the UVE db in redis.
However, when supervisor-analytics service is restarted, then old UVEs remain in the redis.
This is because redis is no longer part of the supervisor-analytics.
Therefore, flush the UVE db from redis when collector connects to redis for the first time.
Closes-Bug: #1347133

Change-Id: If6a455f074b34499827201793fa20d7c7f3c91ea
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
Use cluster-id if provided as db_prefix for api-server/schema-t/svc-mon

Change-Id: Ibaa6f30dccb212a831290a3b9c7dbd312c6872f0
Fix couple of issues related to bgp_server_test.

Following changes are implemented:

- Shutdown the TcpServer right away instead of doing it from Config task
- Tweak CloseDeferred test to work around a race condition in the test

Change-Id: I55f54c415f399a5cc7b1d0bd6743d24bd44cc06f
* Add service vlan routers with ecmp flag, if instance ip is in
  active-active mode
* Test case for same

Change-Id: I58e79ae328e1647adf0bf6215b1feba5330ff605
fix the removal of floating-ip-pools which was happening twice.

Change-Id: Ie45a8aa2617d2112a2575511d82b1e0f6d49c57c
Bug 1337711: List SG for all projects when filtering only by name

Change-Id: I08c010497d901beb9eb9cbe8a321dbec25de2fde
Closes-Bug: 1337711
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