From b8a05333ddc4e248e18080750e3cfa9cbedbca53 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 20 Sep 2016 12:31:37 +0200 Subject: [PATCH] Handle keystoneauth exceptions in retry logic The retry_logic in do_request catches neutronclient errors, but if a SessionClient is being used, nothing throws neutronclient errors - instead keystoneauth Session throws keystoneauth exceptions. Add the keystoneauth.exceptions.ConnectionError to the things that handle the error and retry. Change-Id: If16e50ee53279652fbdfc2d13d5509f46a54124a --- neutronclient/v2_0/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neutronclient/v2_0/client.py b/neutronclient/v2_0/client.py index 4da97e668..374f87391 100644 --- a/neutronclient/v2_0/client.py +++ b/neutronclient/v2_0/client.py @@ -22,6 +22,7 @@ import re import time import debtcollector.renames +from keystoneauth1 import exceptions as ksa_exc import requests import six.moves.urllib.parse as urlparse from six import string_types @@ -335,7 +336,7 @@ class ClientBase(object): try: return self.do_request(method, action, body=body, headers=headers, params=params) - except exceptions.ConnectionFailed: + except (exceptions.ConnectionFailed, ksa_exc.ConnectionError): # Exception has already been logged by do_request() if i < self.retries: _logger.debug('Retrying connection to Neutron service')