It turns out that we ended up with duplicate versions of this function
merging on top of each other within 3 days, and gerrit didn't catch
it. Boo gerrit. Boo bash.
Change-Id: Ic6aa2f9bafdec906de2bc51d5929beeec48a6a40
| ... | ... |
@@ -905,34 +905,6 @@ function get_or_add_user_domain_role {
|
| 905 | 905 |
echo $user_role_id |
| 906 | 906 |
} |
| 907 | 907 |
|
| 908 |
-# Gets or adds user role to domain |
|
| 909 |
-# Usage: get_or_add_user_domain_role <role> <user> <domain> |
|
| 910 |
-function get_or_add_user_domain_role {
|
|
| 911 |
- local user_role_id |
|
| 912 |
- # Gets user role id |
|
| 913 |
- user_role_id=$(openstack role assignment list \ |
|
| 914 |
- --user $2 \ |
|
| 915 |
- --os-url=$KEYSTONE_SERVICE_URI_V3 \ |
|
| 916 |
- --os-identity-api-version=3 \ |
|
| 917 |
- --domain $3 \ |
|
| 918 |
- | grep " $1 " | get_field 1) |
|
| 919 |
- if [[ -z "$user_role_id" ]]; then |
|
| 920 |
- # Adds role to user and get it |
|
| 921 |
- openstack role add $1 \ |
|
| 922 |
- --user $2 \ |
|
| 923 |
- --domain $3 \ |
|
| 924 |
- --os-url=$KEYSTONE_SERVICE_URI_V3 \ |
|
| 925 |
- --os-identity-api-version=3 |
|
| 926 |
- user_role_id=$(openstack role assignment list \ |
|
| 927 |
- --user $2 \ |
|
| 928 |
- --os-url=$KEYSTONE_SERVICE_URI_V3 \ |
|
| 929 |
- --os-identity-api-version=3 \ |
|
| 930 |
- --domain $3 \ |
|
| 931 |
- | grep " $1 " | get_field 1) |
|
| 932 |
- fi |
|
| 933 |
- echo $user_role_id |
|
| 934 |
-} |
|
| 935 |
- |
|
| 936 | 908 |
# Gets or adds group role to project |
| 937 | 909 |
# Usage: get_or_add_group_project_role <role> <group> <project> |
| 938 | 910 |
function get_or_add_group_project_role {
|