From 6226fb73a42a5d5f904d5a7fc5b467c72ddf5115 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Mon, 20 Jul 2015 14:41:39 +0000 Subject: [PATCH] Python 3: fix neutron.tests.unit.agent.linux.test_async_process In Python 3, one cannot compare an integer to None. Change-Id: I8de3ea3752be837540ea65f1bb254a095927de44 Blueprint: neutron-python3 --- neutron/agent/linux/async_process.py | 5 ++++- tox.ini | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/neutron/agent/linux/async_process.py b/neutron/agent/linux/async_process.py index e9879a069..cd25ffb09 100644 --- a/neutron/agent/linux/async_process.py +++ b/neutron/agent/linux/async_process.py @@ -181,7 +181,10 @@ class AsyncProcess(object): """Kill the async process and respawn if necessary.""" LOG.debug('Halting async process [%s] in response to an error.', self.cmd) - respawning = self.respawn_interval >= 0 + if self.respawn_interval is not None and self.respawn_interval >= 0: + respawning = True + else: + respawning = False self._kill(respawning=respawning) if respawning: eventlet.sleep(self.respawn_interval) diff --git a/tox.ini b/tox.ini index 7b8252271..61e807046 100644 --- a/tox.ini +++ b/tox.ini @@ -200,6 +200,7 @@ commands = python -m testtools.run \ neutron.tests.unit.agent.linux.test_ip_monitor \ neutron.tests.unit.agent.linux.test_iptables_manager \ neutron.tests.unit.agent.linux.test_external_process \ + neutron.tests.unit.agent.linux.test_async_process \ neutron.tests.unit.agent.linux.test_ovsdb_monitor \ neutron.tests.unit.agent.linux.test_bridge_lib \ neutron.tests.unit.agent.linux.test_ip_link_support \ -- 2.45.2