epcim
3/16/2017 - 12:16 AM

openstack keystone endpoints recovery script

openstack keystone endpoints recovery script

function serviceName() { keystone service-list 2>/dev/null| egrep $1 | awk -F '|' '{gsub(/ /, "", $0);print $3}'; }

keystone endpoint-list > keystone-endpoint-list.bkp

cat keystone-endpoint-list.bkp \
  | awk -F'|' '{gsub(/ /, "", $0);print "keystone endpoint-create --service $(serviceName "$6") --region "$2" --publicurl \""$3"\" --internalurl \""$4"\" --adminurl \""$5"\""}'