summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-04-17 14:50:52 +0000
committerGerrit Code Review <review@openstack.org>2019-04-17 14:50:52 +0000
commit5ab0ab2e9623d012c9bbead7692c45878174ccca (patch)
treecd229897812f2b8181fda073aa02b77080c4aca0
parentb780b3219f8974a81b17db39707d9717c72e411d (diff)
parente9439a7db769ca89a81e9115c65138d7f77f0526 (diff)
downloadheat-5ab0ab2e9623d012c9bbead7692c45878174ccca.tar.gz
Merge "Catch socket.timeout for connectivity error when streaming" into stable/pike
-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 04e0be1f1..fd0dc8e34 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)