Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- #
- # source openrc [username] [tenantname]
- #
- # Configure a set of credentials for $TENANT/$USERNAME:
- # Set OS_TENANT_NAME to override the default tenant 'demo'
- # Set OS_USERNAME to override the default user name 'demo'
- # Set ADMIN_PASSWORD to set the password for 'admin' and 'demo'
- # NOTE: support for the old NOVA_* novaclient environment variables has
- # been removed.
- if [[ -n "$1" ]]; then
- OS_USERNAME=$1
- fi
- if [[ -n "$2" ]]; then
- OS_TENANT_NAME=$2
- fi
- # Find the other rc files
- RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)
- # Import common functions
- source $RC_DIR/functions
- # Load local configuration
- source $RC_DIR/stackrc
- # Load the last env variables if available
- if [[ -r $RC_DIR/.stackenv ]]; then
- source $RC_DIR/.stackenv
- fi
- # Get some necessary configuration
- source $RC_DIR/lib/tls
- # The introduction of Keystone to the OpenStack ecosystem has standardized the
- # term **tenant** as the entity that owns resources. In some places references
- # still exist to the original Nova term **project** for this use. Also,
- # **tenant_name** is preferred to **tenant_id**.
- export OS_TENANT_NAME=${OS_TENANT_NAME:-demo}
- # In addition to the owning entity (tenant), nova stores the entity performing
- # the action as the **user**.
- export OS_USERNAME=${OS_USERNAME:-demo}
- # With Keystone you pass the keystone password instead of an api key.
- # Recent versions of novaclient use OS_PASSWORD instead of NOVA_API_KEYs
- # or NOVA_PASSWORD.
- export OS_PASSWORD=${ADMIN_PASSWORD:-secrete}
- # Don't put the key into a keyring by default. Testing for development is much
- # easier with this off.
- export OS_NO_CACHE=${OS_NO_CACHE:-1}
- # Region
- export OS_REGION_NAME=${REGION_NAME:-RegionOne}
- # Set the host API endpoint. This will default to HOST_IP if SERVICE_IP_VERSION
- "dev/devstack/openrc" 101L, 3694C
Add Comment
Please, Sign In to add comment