From ca3bf4f20b615ce1145eede9fc8d6985f661c500 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 1 Mar 2017 16:20:35 -0700 Subject: [PATCH] cloud.openstack: Also retry on BaseHTTPError We attach volumes immediately after creating them; sometimes they are still momentarily in the 'creating' state, causing the attach call to throw a BaseHTTPError. When that happens, simply retry the request instead of failing node creation, starting the entire cycle all over again. Signed-off-by: Zack Cerza --- teuthology/provision/cloud/openstack.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teuthology/provision/cloud/openstack.py b/teuthology/provision/cloud/openstack.py index b12d55b060..a8bb5c268f 100644 --- a/teuthology/provision/cloud/openstack.py +++ b/teuthology/provision/cloud/openstack.py @@ -7,7 +7,7 @@ import urllib import yaml from copy import deepcopy -from libcloud.common.exceptions import RateLimitReachedError +from libcloud.common.exceptions import RateLimitReachedError, BaseHTTPError from paramiko import AuthenticationException from paramiko.ssh_exception import NoValidConnectionsError @@ -23,7 +23,7 @@ from teuthology.provision.cloud.base import Provider log = logging.getLogger(__name__) -RETRY_EXCEPTIONS = (RateLimitReachedError, ) +RETRY_EXCEPTIONS = (RateLimitReachedError, BaseHTTPError) def retry(function, *args, **kwargs): -- 2.39.5