summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-20 21:58:22 +0000
committerGerrit Code Review <review@openstack.org>2019-01-20 21:58:22 +0000
commit9c2ff64360cde8c4cb44b535fadd28b5036f83fd (patch)
treec16427ebe7f0a7fe99ed21e379f75c6029b3532a
parentaf9ccd39f9aafca14d3e007111b907551782148d (diff)
parent55733f3847403da851628c4cfc86cb1afaf23249 (diff)
downloadheat-9c2ff64360cde8c4cb44b535fadd28b5036f83fd.tar.gz
Merge "Catch socket.timeout for connectivity error when streaming" into stable/rocky
-rw-r--r--heat/common/urlfetch.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/heat/common/urlfetch.py b/heat/common/urlfetch.py
index 1ef22b40c..54cc90027 100644
--- a/heat/common/urlfetch.py
+++ b/heat/common/urlfetch.py
@@ -13,6 +13,8 @@
"""Utility for fetching a resource (e.g. a template) from a URL."""
+import socket
+
from oslo_config import cfg
from oslo_log import log as logging
import requests
@@ -74,6 +76,6 @@ def get(url, allowed_schemes=('http', 'https')):
cfg.CONF.max_template_size)
return result
- except exceptions.RequestException as ex:
+ except (exceptions.RequestException, socket.timeout) as ex:
LOG.info('Failed to retrieve template: %s', ex)
raise URLFetchError(_('Failed to retrieve template from %s') % url)