summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Luethi <rl@patchworkscience.org>2017-11-09 13:56:56 +0100
committerRoger Luethi <rl@patchworkscience.org>2017-11-13 15:09:22 +0000
commitc678df66d61936b2ada17eb7207ddbdf84baf28a (patch)
tree40d549800a766cfbe14f9ef388c3ce321d259234
parent74026582141ff9289a78579edb56444ac63ee0ac (diff)
Remove domain role from neutron service user
This patch removes the openstack_user resource with :grant_domain action. A user is always created within a specific domain; such a membership cannot be tacked on later. This resource gave the user the role intended for their project for the domain (i.e., for the Default domain instead of for the service project). We add the domain_name attribute that creates the neutron user in the desired domain. Note that this change needs a sufficiently recent openstackclient cookbook -- otherwise the domain_name attribute is ignored (which does not matter as long as the neutron user is to be created in the Default domain). Change-Id: I4b67565c9408c758acefc681dd756a1dca836ec3
Notes
Notes (review): Code-Review+2: Christoph Albers <c.albers@x-ion.de> Code-Review+2: Samuel Cassiba <s@cassiba.com> Workflow+1: Samuel Cassiba <s@cassiba.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 17 Nov 2017 20:22:11 +0000 Reviewed-on: https://review.openstack.org/519379 Project: openstack/cookbook-openstack-network Branch: refs/heads/master
-rw-r--r--recipes/identity_registration.rb8
-rw-r--r--spec/identity_registration_spec.rb11
2 files changed, 2 insertions, 17 deletions
diff --git a/recipes/identity_registration.rb b/recipes/identity_registration.rb
index 448041a..54ce490 100644
--- a/recipes/identity_registration.rb
+++ b/recipes/identity_registration.rb
@@ -86,6 +86,7 @@ end
86# Register Service User 86# Register Service User
87openstack_user service_user do 87openstack_user service_user do
88 project_name service_tenant_name 88 project_name service_tenant_name
89 domain_name service_domain_name
89 password service_pass 90 password service_pass
90 connection_params connection_params 91 connection_params connection_params
91end 92end
@@ -97,10 +98,3 @@ openstack_user service_user do
97 connection_params connection_params 98 connection_params connection_params
98 action :grant_role 99 action :grant_role
99end 100end
100
101openstack_user service_user do
102 domain_name service_domain_name
103 role_name service_role
104 connection_params connection_params
105 action :grant_domain
106end
diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb
index a9b2e83..a8296d2 100644
--- a/spec/identity_registration_spec.rb
+++ b/spec/identity_registration_spec.rb
@@ -67,6 +67,7 @@ describe 'openstack-network::identity_registration' do
67 expect(chef_run).to create_openstack_user( 67 expect(chef_run).to create_openstack_user(
68 service_user 68 service_user
69 ).with( 69 ).with(
70 domain_name: domain_name,
70 project_name: project_name, 71 project_name: project_name,
71 password: password, 72 password: password,
72 connection_params: connection_params 73 connection_params: connection_params
@@ -74,16 +75,6 @@ describe 'openstack-network::identity_registration' do
74 end 75 end
75 76
76 it do 77 it do
77 expect(chef_run).to grant_domain_openstack_user(
78 service_user
79 ).with(
80 domain_name: domain_name,
81 role_name: role_name,
82 connection_params: connection_params
83 )
84 end
85
86 it do
87 expect(chef_run).to grant_role_openstack_user( 78 expect(chef_run).to grant_role_openstack_user(
88 service_user 79 service_user
89 ).with( 80 ).with(