Allow us to retry the Manila client connection

It is possible that Manila looks ready before it is,
so we should retry a bit to ensure that the APi service
is really down before giving up
This commit is contained in:
Chris MacNaughton
2020-01-13 15:26:00 +01:00
parent 4db5794dd9
commit c48801d202

View File

@@ -16,6 +16,7 @@
"""Encapsulate Manila testing."""
from tenacity import Retrying, stop_after_attempt, wait_exponential
from manilaclient import client as manilaclient
@@ -38,4 +39,7 @@ class ManilaTests(test_utils.OpenStackBaseTest):
def test_manila_api(self):
"""Test that the Manila API is working."""
# now just try a list the shares
self.manila_client.shares.list()
for attempt in Retrying(
stop=stop_after_attempt(3),
wait=wait_exponential(multiplier=1, min=2, max=10)):
self.manila_client.shares.list()