Browse Source

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.
Roger Luethi 1 year ago
parent
commit
97239e41a9
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      libraries/openstack_user.rb

+ 5
- 0
libraries/openstack_user.rb View File

@@ -62,6 +62,7 @@ module OpenstackclientCookbook
62 62
       end
63 63
     end
64 64
 
65
+    # Grant a role in a project
65 66
     action :grant_role do
66 67
       user = connection.users.find { |u| u.name == user_name }
67 68
       project = connection.projects.find { |p| p.name == project_name }
@@ -76,6 +77,10 @@ module OpenstackclientCookbook
76 77
       project.revoke_role_from_user role.id, user.id if role && project && user
77 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 84
     action :grant_domain do
80 85
       user = connection.users.find { |u| u.name == user_name }
81 86
       domain = connection.domains.find { |p| p.name == domain_name }

Loading…
Cancel
Save