]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Python 3: fix neutron.tests.unit.agent.linux.test_async_process
authorCyril Roelandt <cyril@redhat.com>
Mon, 20 Jul 2015 14:41:39 +0000 (14:41 +0000)
committerCyril Roelandt <cyril@redhat.com>
Mon, 20 Jul 2015 15:02:14 +0000 (17:02 +0200)
In Python 3, one cannot compare an integer to None.

Change-Id: I8de3ea3752be837540ea65f1bb254a095927de44
Blueprint: neutron-python3

neutron/agent/linux/async_process.py
tox.ini

index e9879a0696af736589adbd518f82c6093dc77b49..cd25ffb0951c2207f1238a64e0b0ea452275b454 100644 (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)
diff --git a/tox.ini b/tox.ini
index 7b8252271c1e7a94d736e5fd5b3c0d34e38d5eee..61e80704687839839bb07b6724f6bc08a0ce712d 100644 (file)
--- 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 \