diff --git a/lib/puppet/provider/neutron.rb b/lib/puppet/provider/neutron.rb index 9637dcf4f..3120ae589 100644 --- a/lib/puppet/provider/neutron.rb +++ b/lib/puppet/provider/neutron.rb @@ -114,10 +114,12 @@ class Puppet::Provider::Neutron < Puppet::Provider::Openstack def self.auth_neutron(*args) q = neutron_credentials authenv = { - :OS_AUTH_URL => self.auth_endpoint, - :OS_USERNAME => q['username'], - :OS_PROJECT_NAME => q['project_name'], - :OS_PASSWORD => q['password'] + :OS_AUTH_URL => self.auth_endpoint, + :OS_USERNAME => q['username'], + :OS_PROJECT_NAME => q['project_name'], + :OS_PASSWORD => q['password'], + :OS_PROJECT_DOMAIN_NAME => q['project_domain_name'], + :OS_USER_DOMAIN_NAME => q['user_domain_name'] } if q.key?('region_name') authenv[:OS_REGION_NAME] = q['region_name'] diff --git a/releasenotes/notes/switch-keystone-to-v3-8c2c2111fe29c57c.yaml b/releasenotes/notes/switch-keystone-to-v3-8c2c2111fe29c57c.yaml new file mode 100644 index 000000000..3b972a51c --- /dev/null +++ b/releasenotes/notes/switch-keystone-to-v3-8c2c2111fe29c57c.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + neutron auth provider has been switch to use keystone API v3. diff --git a/spec/unit/provider/neutron_spec.rb b/spec/unit/provider/neutron_spec.rb index f76fdfd5c..0cf2e0064 100644 --- a/spec/unit/provider/neutron_spec.rb +++ b/spec/unit/provider/neutron_spec.rb @@ -11,10 +11,12 @@ describe Puppet::Provider::Neutron do let :credential_hash do { - 'project_name' => 'admin_tenant', - 'username' => 'admin', - 'password' => 'password', - 'auth_uri' => 'https://192.168.56.210:35357/v2.0/', + 'project_name' => 'admin_tenant', + 'username' => 'admin', + 'password' => 'password', + 'auth_uri' => 'https://192.168.56.210:35357/v2.0/', + 'project_domain_name' => 'Default', + 'user_domain_name' => 'Default', } end @@ -63,10 +65,12 @@ describe Puppet::Provider::Neutron do it 'should set auth credentials in the environment' do authenv = { - :OS_AUTH_URL => credential_hash['auth_uri'], - :OS_USERNAME => credential_hash['username'], - :OS_PROJECT_NAME => credential_hash['project_name'], - :OS_PASSWORD => credential_hash['password'], + :OS_AUTH_URL => credential_hash['auth_uri'], + :OS_USERNAME => credential_hash['username'], + :OS_PROJECT_NAME => credential_hash['project_name'], + :OS_PASSWORD => credential_hash['password'], + :OS_PROJECT_DOMAIN_NAME => credential_hash['project_domain_name'], + :OS_USER_DOMAIN_NAME => credential_hash['user_domain_name'], } klass.expects(:get_neutron_credentials).with().returns(credential_hash) klass.expects(:withenv).with(authenv) @@ -75,11 +79,13 @@ describe Puppet::Provider::Neutron do it 'should set region in the environment if needed' do authenv = { - :OS_AUTH_URL => credential_hash['auth_uri'], - :OS_USERNAME => credential_hash['username'], - :OS_PROJECT_NAME => credential_hash['project_name'], - :OS_PASSWORD => credential_hash['password'], - :OS_REGION_NAME => 'REGION_NAME', + :OS_AUTH_URL => credential_hash['auth_uri'], + :OS_USERNAME => credential_hash['username'], + :OS_PROJECT_NAME => credential_hash['project_name'], + :OS_PASSWORD => credential_hash['password'], + :OS_REGION_NAME => 'REGION_NAME', + :OS_PROJECT_DOMAIN_NAME => credential_hash['project_domain_name'], + :OS_USER_DOMAIN_NAME => credential_hash['user_domain_name'], } cred_hash = credential_hash.merge({'region_name' => 'REGION_NAME'})