From 99dc6d34754954a27f6998406a94743c41b93981 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Wed, 28 Oct 2015 07:45:57 +0200 Subject: [PATCH] Handle correct exception raised by python-novaclient We need to hanle both novaclient.exceptions.RequestTimeout and requests.Timeout to make it works with a different python-nocaclient versions. Change-Id: Ib58101f12c87653aef97e055d22542acbeeee4a7 Closes-Bug: #1510790 --- cinder/compute/nova.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cinder/compute/nova.py b/cinder/compute/nova.py index 58a349da5..98101210b 100644 --- a/cinder/compute/nova.py +++ b/cinder/compute/nova.py @@ -163,7 +163,7 @@ class API(base.Base): def has_extension(self, context, extension, timeout=None): try: nova_exts = nova_client.discover_extensions(NOVA_API_VERSION) - except request_exceptions.Timeout: + except (nova_exceptions.RequestTimeout, request_exceptions.Timeout): raise exception.APITimeout(service='Nova') return extension in [e.name for e in nova_exts] @@ -196,5 +196,5 @@ class API(base.Base): timeout=timeout).servers.get(server_id) except nova_exceptions.NotFound: raise exception.ServerNotFound(uuid=server_id) - except request_exceptions.Timeout: + except (nova_exceptions.RequestTimeout, request_exceptions.Timeout): raise exception.APITimeout(service='Nova') -- 2.45.2