From 97239e41a9852a18d7204846d14a4e6b415ed536 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Wed, 1 Nov 2017 10:56:01 +0100 Subject: [PATCH] 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. --- libraries/openstack_user.rb | 5 +++++ 1 file changed, 5 insertions(+) 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 end end + # Grant a role in a project action :grant_role do user = connection.users.find { |u| u.name == user_name } project = connection.projects.find { |p| p.name == project_name } @@ -76,6 +77,10 @@ module OpenstackclientCookbook project.revoke_role_from_user role.id, user.id if role && project && user end + # Grant a role in a domain + # Note: in spite of what the action name may suggest, the domain name is + # only used to identify a user who is in that domain. This action grants + # the user a role in the domain. action :grant_domain do user = connection.users.find { |u| u.name == user_name } domain = connection.domains.find { |p| p.name == domain_name }