Improve test_neutron_agents_are_alive on cloud recovery

Change-Id: I21b3678b0eb0f4db42a84baa78b3de56975f4dc6
This commit is contained in:
Federico Ressi 2021-09-21 11:10:41 +02:00
parent 4af7676b3a
commit dc1ecea9e6

View File

@ -5,6 +5,7 @@ import json
import re import re
import typing import typing
from keystoneauth1 import exceptions
from oslo_log import log from oslo_log import log
import tobiko import tobiko
@ -42,7 +43,8 @@ def test_neutron_agents_are_alive(timeout=300., interval=5.) \
# get Neutron agent list # get Neutron agent list
agents = neutron.list_agents() agents = neutron.list_agents()
except (neutron.ServiceUnavailable, except (neutron.ServiceUnavailable,
neutron.NeutronClientException) as ex: neutron.NeutronClientException,
exceptions.connection.ConnectFailure) as ex:
if attempt.is_last: if attempt.is_last:
raise raise
else: else: