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
This commit is contained in:
Cyril Roelandt 2015-07-20 14:41:39 +00:00
parent 11c0900dea
commit 6226fb73a4
2 changed files with 5 additions and 1 deletions

View File

@ -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)

View File

@ -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 \