Skip to content

Instantly share code, notes, and snippets.

@chianingwang
Created July 20, 2016 22:28
Show Gist options
  • Save chianingwang/5ffdbc0cb49b80de73238681a3ac77a1 to your computer and use it in GitHub Desktop.
Save chianingwang/5ffdbc0cb49b80de73238681a3ac77a1 to your computer and use it in GitHub Desktop.
#!/bin/bash
keystone tenant-list|grep -v -- "-----"|egrep -v "id.*\|.*name"|awk '{ print $2 }'|while read TENANT; do
echo $TENANT
keystone user-list --tenant $TENANT|grep -v -- "-----"|egrep -v "id.*\|.*name"|awk '{ print $2 }'|while read USER;do
echo " @ $USER"
keystone user-role-list --user $USER --tenant_id $TENANT|grep -v -- "-----"|egrep -v "id.*\|.*name"|awk '{ print $2 }'|while read ROLE; do
echo " > $ROLE"
done
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment