Skip to content

Commit

Permalink
Use 'openstack subnet list' to retrieve VIP subnets
Browse files Browse the repository at this point in the history
Using 'openstack subnet show' on a subnet that does not
exist will return an error, instead use 'subnet list'
with --name which will just return an empty string if
it is not found.
  • Loading branch information
brianphaley committed May 24, 2024
1 parent cf3e09a commit ca553da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/generate_bundle_base
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ update_master_opts ${MOD_PASSTHROUGH_OPTS[@]}
vip_start=${MASTER_OPTS[VIP_ADDR_START]}
if [[ -z $vip_start ]]; then
# prodstack
cidr=$(source ~/novarc; openstack subnet show subnet_${OS_USERNAME} -c cidr -f value 2>/dev/null || true)
cidr=$(source ~/novarc; openstack subnet list --name subnet_${OS_USERNAME} -c Subnet -f value 2>/dev/null)
if [[ -z $cidr ]]; then
# stsstack
cidr=$(source ~/novarc; openstack subnet show ${OS_USERNAME}_admin_subnet -c cidr -f value 2>/dev/null || true)
cidr=$(source ~/novarc; openstack subnet list --name ${OS_USERNAME}_admin_subnet -c Subnet -f value 2>/dev/null)
fi
if [[ -n $cidr ]]; then
vip_start=$(echo $cidr| sed -r 's/([0-9]+\.[0-9]+).+/\1/g').150.0
Expand Down

0 comments on commit ca553da

Please sign in to comment.