-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsavienvrc
44 lines (38 loc) · 1.41 KB
/
savienvrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
#
# source savienvrc [username] [tenantname]
#
# This file is based on devstack/openrc and use it
#
# 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'
# Devstack installation folder
# Find the other rc files
RC_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd)
# Load local configuration
source $RC_DIR/savirc
KING_DIR=$DEST/$KING
COLLEGE_DIR=$DEST/$COLLEGE
NODE_LOCATION=${NODE_LOCATION:-tr-edge-1}
# TODO(eliot): Need to configure it later
NETWORK=savinetwork
# Use functions for getting token
source $RC_DIR/functions
source $DEVSTACK_DIR/openrc $1 $2
TOKEN=$(keystone token-get | grep ' id ' | get_field 2)
SWIFT_ENDPOINT=$(keystone catalog | grep 'publicURL' | grep '8080' | grep 'AUTH' | get_field 2)
echo "For SAVI TB control service"
echo "User: $OS_USERNAME, Tenant: $OS_TENANT_NAME"
export SAVI_HOST=$HOST_IP
export CONTROL_WSDL=http://$SAVI_HOST:9080/ws/ControlService?wsdl
export SAVI_JAR=$KING_DIR/dist/$KING-$SAVI_VERSION.jar
export SAVI_HW_JAR=$COLLEGE_DIR/dist/$COLLEGE-$SAVI_VERSION.jar
export SAVI_USER=$OS_USERNAME
export SAVI_PASSWORD=$OS_PASSWORD
export SAVI_TOKEN=$TOKEN
export SAVI_AUTH_URL=$SWIFT_ENDPOINT
export SAVI_PROJECT=$OS_TENANT_NAME
export SAVI_LOCATION=$NODE_LOCATION
export SAVI_NETWORK=$NETWORK