Fix chicken and eggs problem with tripleo-heat-templates

There is a current effort on tripleo-heat-templates to manage keystone
resources directly via puppet. The effort is separate in two patchset
one to replace the current keystone.initialize() and the other other to
replace setup-endpoints().

This review is necessary in order to make CI pass the upstream jobs.
The whole keystone functions call will be removed then.

Change-Id: Ia4b3244f114dcff746ab89d355ad4933f8fdbddf
This commit is contained in:
Yanis Guenane 2015-10-16 09:36:57 +02:00
parent 2aac09de13
commit 584c95f36a

View File

@ -27,6 +27,7 @@ import uuid
from cliff import command
from heatclient.common import template_utils
from keystoneclient import exceptions as kscexc
from openstackclient.common import exceptions as oscexc
from openstackclient.common import utils as osc_utils
from openstackclient.i18n import _
@ -460,6 +461,9 @@ class DeployOvercloud(command.Command):
if not keystone_ip:
keystone_ip = overcloud_ip
# Note (spredzy): This was deprecated at the begining of
# the Mitaka cycle. Should be good to remove for the
# next N cycle.
keystone.initialize(
keystone_ip,
utils.get_password('OVERCLOUD_ADMIN_TOKEN'),
@ -488,6 +492,10 @@ class DeployOvercloud(command.Command):
service_data['internal_host'] = internal_vip
services.update({service: service_data})
# Note (spredzy): This was deprecated at the begining of
# the Mitaka cycle. Should be good to remove for the
# next N cycle.
try:
keystone_client = clients.get_keystone_client(
'admin',
utils.get_password('OVERCLOUD_ADMIN_PASSWORD'),
@ -498,6 +506,16 @@ class DeployOvercloud(command.Command):
client=keystone_client,
os_auth_url=overcloud_endpoint,
public_host=overcloud_ip)
except kscexc.Conflict:
pass
else:
self.log.warning("Setting up keystone endpoints via "
"os-cloud-config. This behavior is "
"deprecated and will be removed in "
"a future release. Please update "
"your heat templates to a version "
"that does Keystone initialization "
"via Puppet.")
compute_client = clients.get_nova_bm_client(
'admin',