The admin username is fetched from the user list
Now the admin username is not default "admin", but some value
admin* with some random string. Since the admin username was
hardcoded, the adding admin to the cvp.project failed.
Fixed this now.
Related-PROD: PROD-37187
Change-Id: I822288bbf6a7ef7efc7a5aa55c134c1ec7c760b3
diff --git a/scripts/prepare.sh b/scripts/prepare.sh
index f26e9b3..78341b2 100644
--- a/scripts/prepare.sh
+++ b/scripts/prepare.sh
@@ -191,7 +191,8 @@
function _project() {
echo project create ${project} >>${cmds}
- echo role add --user admin --project ${project} admin >>${cmds}
+ admin_username=$(openstack user list --project admin -c Name -f value | grep admin)
+ echo role add --user ${admin_username} --project ${project} admin >>${cmds}
}
function _users() {