epcim
1/13/2017 - 6:04 PM

openstack-keystone.sh

source keystonerc

function tenantid() {
  # $1 - tenant name
  keystone tenant-list 2>/dev/null |grep " $1 " | awk '{print $2}' 
 }


function sec-grp-id() {
  # $1 - tenant name
  # $2 - sec group name
  neutron security-group-list --tenant-id $(tenantid $1)  -fvalue | grep " $2 " |awk '{print $1}' 
}