From 0bc3f43b551efacefe3f0099799ac7e4f27bba3d Mon Sep 17 00:00:00 2001 From: Jens Harbott Date: Fri, 12 Apr 2019 12:26:18 +0000 Subject: [PATCH] Drop admin endpoints The admin endpoints offer no special functionality, users may talk to the public endpoints instead. The only historic use case has been the keystone v2 admin endpoint, but with keystone v3 API, even that is no longer needed. Also drop the attribute for setting an auth version, as keystone only supports v3 now. [0] https://opendev.org/openstack/openstack-chef-specs/src/branch/master/specs/ocata/all/drop-admin-endpoints.rst Change-Id: Id8fa969af80bcb1cb6f3ce743b1861f26c36523f --- README.md | 3 --- attributes/default.rb | 4 ---- libraries/endpoints.rb | 4 ++-- spec/endpoints_spec.rb | 2 +- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 1df08e51..3fc33514 100644 --- a/README.md +++ b/README.md @@ -139,9 +139,6 @@ This cookbook exposes a set of default library routines: * `cli` -- Used to call openstack CLIs * `endpoint` -- Used to return a `::URI` object representing the named OpenStack endpoint -* `admin_endpoint` -- Used to return a `::URI` object representing the named - OpenStack admin endpoint if one was specified. Otherwise, it will return the -same value as `endpoint`. * `internal_endpoint` -- Used to return a `::URI` object representing the named OpenStack internal endpoint if one was specified. Otherwise, it will return the same value as `endpoint`. diff --git a/attributes/default.rb b/attributes/default.rb index d65509e1..9bde2780 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -150,10 +150,6 @@ default['openstack']['endpoints']['family'] = 'inet' # Set a default region that other regions are set to - such that changing the region for all services can be done in one place default['openstack']['region'] = 'RegionOne' -# Set a default auth api version that other components use to interact with identity service. -# Allowed auth API versions: v2.0 or v3.0. By default, it is set to v3.0. -default['openstack']['api']['auth']['version'] = 'v3.0' - # Allow configured loggers in logging.conf default['openstack']['logging']['loggers'] = { 'root' => { diff --git a/libraries/endpoints.rb b/libraries/endpoints.rb index d565e4ce..46bf5765 100644 --- a/libraries/endpoints.rb +++ b/libraries/endpoints.rb @@ -86,9 +86,9 @@ module ::Openstack end end - # Find the specific endpoint type ('internal', 'admin' or + # Find the specific endpoint type ('internal' or # 'public') for the given service. - %w(public internal admin).each do |ep_type| + %w(public internal).each do |ep_type| define_method("#{ep_type}_endpoint") do |service| uri_from_hash(node['openstack']['endpoints'][ep_type][service]) end diff --git a/spec/endpoints_spec.rb b/spec/endpoints_spec.rb index 01c1b495..a44323eb 100644 --- a/spec/endpoints_spec.rb +++ b/spec/endpoints_spec.rb @@ -10,7 +10,7 @@ describe 'openstack-common::default' do let(:chef_run) { runner.converge(described_recipe) } let(:subject) { Object.new.extend(Openstack) } - %w(public internal admin).each do |ep_type| + %w(public internal).each do |ep_type| describe "#{ep_type}_endpoint" do it 'fails with a NoMethodError when no openstack.endpoints in node attrs' do allow(subject).to receive(:node).and_return({})