Skip to content

Instantly share code, notes, and snippets.

@uksysadmin
Created June 23, 2014 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uksysadmin/44a31ba70af075d52065 to your computer and use it in GitHub Desktop.
Save uksysadmin/44a31ba70af075d52065 to your computer and use it in GitHub Desktop.
Awful bash-fu keystone user/tenant list
function ksuserlist() {
if [ -z "$1" ]
then
P="\ "
else
P=$1
fi
keystone user-list | awk '/(True|False)/ { print $4 }' | while read U; do user=$(echo $U); keystone user-get $U | echo $user $(awk '/tenantId/ { print $4 }') | egrep "$P"; done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment