2018-10-06 18:59:41 +00:00
|
|
|
#
|
|
|
|
# Exposes information about the OpenStack environment via the $os_info associative
|
|
|
|
# array.
|
|
|
|
#
|
|
|
|
|
|
|
|
# function os-info {
|
|
|
|
|
|
|
|
local tenant
|
|
|
|
local tenant_format
|
|
|
|
local tenant_formatted
|
|
|
|
|
|
|
|
unset os_info
|
|
|
|
typeset -gA os_info
|
|
|
|
|
2019-06-21 16:42:37 +00:00
|
|
|
[[ -n "${OS_PROJECT_NAME+1}" ]] && tenant="${OS_PROJECT_NAME}"
|
2018-10-06 18:59:41 +00:00
|
|
|
|
|
|
|
if [[ "$tenant" != (none|) ]]; then
|
|
|
|
zstyle -s ':prezto:module:openstack:info:tenant' format 'tenant_format'
|
2019-06-21 16:42:37 +00:00
|
|
|
zformat -f tenant_formatted "$tenant_format" "v:$tenant"
|
2018-10-06 18:59:41 +00:00
|
|
|
os_info[tenant]="$tenant_formatted"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# }
|