summaryrefslogtreecommitdiff
path: root/nova/image
diff options
context:
space:
mode:
authorEric Fried <efried@us.ibm.com>2017-09-19 11:03:27 -0500
committerEric Fried <efried@us.ibm.com>2017-10-10 13:03:26 +0000
commitc56fc55170d16e31f2f304e526df975ced857ba6 (patch)
treeb2466a49678d91af9c7609d68acc0db6627c47c6 /nova/image
parent232458ae4e83e8b218397e42435baa9f1d025b68 (diff)
downloadnova-c56fc55170d16e31f2f304e526df975ced857ba6.tar.gz
Don't fix protocol-less glance api_servers anymore
Operators omitting the protocol (http(s)) from their [glance]api_servers value(s) have had long enough to fix it. Use it as is; and if the protocol is omitted, let it fail hard in the request. Change-Id: Ifebc9192e1e754180c97a3e40806c1c496a8b715
Diffstat (limited to 'nova/image')
-rw-r--r--nova/image/glance.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/nova/image/glance.py b/nova/image/glance.py
index eb4e96772d..388083b002 100644
--- a/nova/image/glance.py
+++ b/nova/image/glance.py
@@ -113,17 +113,8 @@ def get_api_servers():
# NOTE(efried): utils.get_ksa_adapter().get_endpoint() is the preferred
# mechanism for endpoint discovery. Only use `api_servers` if you really
# need to shuffle multiple endpoints.
- api_servers = []
if CONF.glance.api_servers:
- for api_server in CONF.glance.api_servers:
- if '//' not in api_server:
- api_server = 'http://' + api_server
- # NOTE(sdague): remove in O.
- LOG.warning("No protocol specified in for api_server '%s', "
- "please update [glance] api_servers with fully "
- "qualified url including scheme (http / https)",
- api_server)
- api_servers.append(api_server)
+ api_servers = CONF.glance.api_servers
random.shuffle(api_servers)
else:
# TODO(efried): Plumb in a reasonable auth from callers' contexts
@@ -131,8 +122,8 @@ def get_api_servers():
nova.conf.glance.DEFAULT_SERVICE_TYPE,
min_version='2.0', max_version='2.latest')
# TODO(efried): Use ksa_adap.get_endpoint() when bug #1707995 is fixed.
- api_servers.append(ksa_adap.endpoint_override or
- ksa_adap.get_endpoint_data().catalog_url)
+ api_servers = [ksa_adap.endpoint_override or
+ ksa_adap.get_endpoint_data().catalog_url]
return itertools.cycle(api_servers)