| Salvatore Orlando | d6767d0 | 2012-08-31 04:55:20 -0700 | [diff] [blame^] | 1 | # lib/quantum | 
|  | 2 | # functions - funstions specific to quantum | 
|  | 3 |  | 
|  | 4 | # Save trace setting | 
|  | 5 | XTRACE=$(set +o | grep xtrace) | 
|  | 6 | set +o xtrace | 
|  | 7 |  | 
|  | 8 | # Configures keystone integration for quantum service and agents | 
|  | 9 | function quantum_setup_keystone() { | 
|  | 10 | local conf_file=$1 | 
|  | 11 | local section=$2 | 
|  | 12 | local use_auth_url=$3 | 
|  | 13 | if [[ -n $use_auth_url ]]; then | 
|  | 14 | iniset $conf_file $section auth_url "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_AUTH_HOST:$KEYSTONE_AUTH_PORT/v2.0" | 
|  | 15 | else | 
|  | 16 | iniset $conf_file $section auth_host $KEYSTONE_SERVICE_HOST | 
|  | 17 | iniset $conf_file $section auth_port $KEYSTONE_AUTH_PORT | 
|  | 18 | iniset $conf_file $section auth_protocol $KEYSTONE_SERVICE_PROTOCOL | 
|  | 19 | fi | 
|  | 20 | iniset $conf_file $section admin_tenant_name $SERVICE_TENANT_NAME | 
|  | 21 | iniset $conf_file $section admin_user $Q_ADMIN_USERNAME | 
|  | 22 | iniset $conf_file $section admin_password $SERVICE_PASSWORD | 
|  | 23 | } | 
|  | 24 |  | 
|  | 25 | function quantum_setup_ovs_bridge() { | 
|  | 26 | local bridge=$1 | 
|  | 27 | for PORT in `sudo ovs-vsctl --no-wait list-ports $bridge`; do | 
|  | 28 | if [[ "$PORT" =~ tap* ]]; then echo `sudo ip link delete $PORT` > /dev/null; fi | 
|  | 29 | sudo ovs-vsctl --no-wait del-port $bridge $PORT | 
|  | 30 | done | 
|  | 31 | sudo ovs-vsctl --no-wait -- --if-exists del-br $bridge | 
|  | 32 | sudo ovs-vsctl --no-wait add-br $bridge | 
|  | 33 | sudo ovs-vsctl --no-wait br-set-external-id $bridge bridge-id $bridge | 
|  | 34 | } | 
|  | 35 |  | 
|  | 36 | # Restore xtrace | 
|  | 37 | $XTRACE |