From 74424c4a4bbcf32dd6133ed0190515e300f2eccb Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Mon, 17 Oct 2016 13:26:15 +0200 Subject: [PATCH] Enable Keystone v3 support for providers tempest_glance_id_setter and tempest_neutron_net_id_setter were previously using Credentialsv2_0, which do not work in a Keystone v3 environment (and that's what we should be using today). Closes-Bug: #1633864 Change-Id: I95ea682064ff6365622fc31c562b42014fc52303 --- lib/puppet/provider/tempest.rb | 7 +++++++ lib/puppet/provider/tempest_glance_id_setter/openstack.rb | 2 +- .../provider/tempest_neutron_net_id_setter/openstack.rb | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/tempest.rb b/lib/puppet/provider/tempest.rb index 6ec9e2d1..68d145cc 100644 --- a/lib/puppet/provider/tempest.rb +++ b/lib/puppet/provider/tempest.rb @@ -27,6 +27,11 @@ class Puppet::Provider::Tempest < Puppet::Provider::Openstack @credentials.password = tempest_credentials['admin_password'] @credentials.project_name = tempest_credentials['admin_project_name'] @credentials.auth_url = tempest_credentials['auth_endpoint'] + if @credentials.version == '3' + @credentials.user_domain_name = tempest_credentials['admin_domain_name'] + @credentials.project_domain_name = tempest_credentials['admin_domain_name'] + @credentials.auth_url = tempest_credentials['auth_endpoint_v3'] + end raise error unless @credentials.set? Puppet::Provider::Openstack.request(service, action, properties, @credentials) end @@ -37,6 +42,8 @@ class Puppet::Provider::Tempest < Puppet::Provider::Openstack t['admin_password'] = tempest_file['auth']['admin_password'] t['admin_project_name'] = tempest_file['auth']['admin_project_name'] t['auth_endpoint'] = tempest_file['identity']['uri'] + t['auth_endpoint_v3'] = tempest_file['identity']['uri_v3'] + t['admin_domain_name'] = tempest_file['auth']['admin_domain_name'] return t end diff --git a/lib/puppet/provider/tempest_glance_id_setter/openstack.rb b/lib/puppet/provider/tempest_glance_id_setter/openstack.rb index bc43360e..7c91223e 100644 --- a/lib/puppet/provider/tempest_glance_id_setter/openstack.rb +++ b/lib/puppet/provider/tempest_glance_id_setter/openstack.rb @@ -5,7 +5,7 @@ Puppet::Type.type(:tempest_glance_id_setter).provide( :parent => Puppet::Provider::Tempest ) do - @credentials = Puppet::Provider::Openstack::CredentialsV2_0.new + @credentials = Puppet::Provider::Openstack::CredentialsV3.new def exists? lines.find do |line| diff --git a/lib/puppet/provider/tempest_neutron_net_id_setter/openstack.rb b/lib/puppet/provider/tempest_neutron_net_id_setter/openstack.rb index 1a60133d..e9542d6b 100644 --- a/lib/puppet/provider/tempest_neutron_net_id_setter/openstack.rb +++ b/lib/puppet/provider/tempest_neutron_net_id_setter/openstack.rb @@ -5,7 +5,7 @@ Puppet::Type.type(:tempest_neutron_net_id_setter).provide( :parent => Puppet::Provider::Tempest ) do - @credentials = Puppet::Provider::Openstack::CredentialsV2_0.new + @credentials = Puppet::Provider::Openstack::CredentialsV3.new def exists? lines.find do |line|