summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Luethi <rl@patchworkscience.org>2017-11-01 10:56:01 +0100
committerRoger Luethi <rl@patchworkscience.org>2017-11-02 15:28:09 +0100
commit97239e41a9852a18d7204846d14a4e6b415ed536 (patch)
tree4111a76619adcfc290eb13e44b4ba9e7e85ad719
parentbfafac1d99b963c0866a98bb95a6f8e2e4e7c56e (diff)
Add comments to openstack_user.rb
The new comments try to clarify the purpose of the ":grant_domain" action of the openstack_user resource. In contrast to what the name may suggest, the action does not grant a domain (which is not possible). Instead, it grants a role to a user who is already in a specific domain. The domain attribute is merely used to identify the user.
-rw-r--r--libraries/openstack_user.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/libraries/openstack_user.rb b/libraries/openstack_user.rb
index ec40b82..4fd8d2d 100644
--- a/libraries/openstack_user.rb
+++ b/libraries/openstack_user.rb
@@ -62,6 +62,7 @@ module OpenstackclientCookbook
62 end 62 end
63 end 63 end
64 64
65 # Grant a role in a project
65 action :grant_role do 66 action :grant_role do
66 user = connection.users.find { |u| u.name == user_name } 67 user = connection.users.find { |u| u.name == user_name }
67 project = connection.projects.find { |p| p.name == project_name } 68 project = connection.projects.find { |p| p.name == project_name }
@@ -76,6 +77,10 @@ module OpenstackclientCookbook
76 project.revoke_role_from_user role.id, user.id if role && project && user 77 project.revoke_role_from_user role.id, user.id if role && project && user
77 end 78 end
78 79
80 # Grant a role in a domain
81 # Note: in spite of what the action name may suggest, the domain name is
82 # only used to identify a user who is in that domain. This action grants
83 # the user a role in the domain.
79 action :grant_domain do 84 action :grant_domain do
80 user = connection.users.find { |u| u.name == user_name } 85 user = connection.users.find { |u| u.name == user_name }
81 domain = connection.domains.find { |p| p.name == domain_name } 86 domain = connection.domains.find { |p| p.name == domain_name }