From 49a66dba31f23d54972e962beef66c39307904df Mon Sep 17 00:00:00 2001 From: Michal Arbet Date: Thu, 11 Apr 2019 17:14:48 +0200 Subject: [PATCH] Fix py3 compatibility In fetch_and_sync_all_routers method is used python's range function. Range function accepts integers. This patch is fixing divide behaviour in py3 where result number is float, by retyping float to int as it is represented in py2. Change-Id: Ifffdee0d4a3226d4871cfabd0bdbf13d7058a83e Closes-Bug: #1824334 --- neutron/agent/l3/agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/agent/l3/agent.py b/neutron/agent/l3/agent.py index 5b0e14f35d9..0a968bdfb57 100644 --- a/neutron/agent/l3/agent.py +++ b/neutron/agent/l3/agent.py @@ -876,7 +876,7 @@ class L3NATAgent(ha.AgentMixin, except oslo_messaging.MessagingTimeout: if self.sync_routers_chunk_size > SYNC_ROUTERS_MIN_CHUNK_SIZE: self.sync_routers_chunk_size = max( - self.sync_routers_chunk_size / 2, + self.sync_routers_chunk_size // 2, SYNC_ROUTERS_MIN_CHUNK_SIZE) LOG.error('Server failed to return info for routers in ' 'required time, decreasing chunk size to: %s',