From a9702301b4f2cba805bbb2239a88b6f897ef7095 Mon Sep 17 00:00:00 2001
From: Jean-Philippe Evrard <jean-philippe@evrard.me>
Date: Tue, 5 Dec 2017 08:07:14 +0000
Subject: [PATCH] Handle Pike deprecations for Ironic

Following the release notes:
https://docs.openstack.org/releasenotes/ironic/pike.html

On top of that, ironic_glance_host was never used anywhere, and was
removed.

Change-Id: I1fbdc0660eccd75299e734b36b99509d388348cf
---
 defaults/main.yml        | 1 -
 templates/ironic.conf.j2 | 6 +++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/defaults/main.yml b/defaults/main.yml
index eb744ffd..899d1c89 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -249,7 +249,6 @@ ironic_uwsgi_bind_address: 0.0.0.0
 ### OpenStack Services to integrate with
 
 # Glance
-# ironic_glance_host: x.x.x.x
 ironic_glance_auth_strategy: "{{ ironic_openstack_auth_strategy }}"
 
 # Neutron
diff --git a/templates/ironic.conf.j2 b/templates/ironic.conf.j2
index b57b6582..a9d10da0 100644
--- a/templates/ironic.conf.j2
+++ b/templates/ironic.conf.j2
@@ -44,6 +44,9 @@ pool_timeout = {{ ironic_db_pool_timeout }}
 
 [deploy]
 erase_devices_priority = {{ ironic_erase_devices_priority }}
+{% if not ironic_standalone | bool %}
+object_store_endpoint_type = {{ ironic_swift_url_endpoint_type }}
+{% endif %}
 
 [dhcp]
 dhcp_provider = {{ ironic_dhcp_provider }}
@@ -53,6 +56,8 @@ dhcp_provider = {{ ironic_dhcp_provider }}
 [disk_utils]
 
 [glance]
+# TODO(evrardjp): Remove this in the future to use the service catalog
+# and reduce the amount of variables.
 glance_api_servers = {{ glance_api_servers }}
 {% if not ironic_standalone | bool %}
 swift_temp_url_key = {{ ironic_swift_temp_url_secret_key }}
@@ -60,7 +65,6 @@ swift_container = {{ ironic_swift_image_container }}
 swift_endpoint_url = {{ ironic_swift_endpoint }}
 swift_account = {{ ironic_swift_auth_account }}
 swift_api_version = {{ ironic_swift_api_version }}
-temp_url_endpoint_type = {{ ironic_swift_url_endpoint_type }}
 {% endif %}
 
 [iboot]