Simplify database_connection_url
* does not expects dynamic scoping. * does not uses eval. Change-Id: I5ba4e5b7ffaabbb3c2bddadf9e53a2875de8b7c0
This commit is contained in:
parent
48053c791d
commit
7e79d9139f
@ -68,7 +68,7 @@ function configure_ceilometer() {
|
|||||||
|
|
||||||
iniset $CEILOMETER_CONF DEFAULT notification_topics 'notifications,glance_notifications'
|
iniset $CEILOMETER_CONF DEFAULT notification_topics 'notifications,glance_notifications'
|
||||||
iniset $CEILOMETER_CONF DEFAULT verbose True
|
iniset $CEILOMETER_CONF DEFAULT verbose True
|
||||||
iniset $CEILOMETER_CONF DEFAULT sql_connection $BASE_SQL_CONN/nova?charset=utf8
|
iniset $CEILOMETER_CONF DEFAULT `database_connection_url nova`
|
||||||
|
|
||||||
# Install the policy file for the API server
|
# Install the policy file for the API server
|
||||||
cp $CEILOMETER_DIR/etc/ceilometer/policy.json $CEILOMETER_CONF_DIR
|
cp $CEILOMETER_DIR/etc/ceilometer/policy.json $CEILOMETER_CONF_DIR
|
||||||
|
@ -185,9 +185,7 @@ function configure_cinder() {
|
|||||||
iniset $CINDER_CONF DEFAULT volume_name_template ${VOLUME_NAME_PREFIX}%s
|
iniset $CINDER_CONF DEFAULT volume_name_template ${VOLUME_NAME_PREFIX}%s
|
||||||
fi
|
fi
|
||||||
iniset $CINDER_CONF DEFAULT iscsi_helper tgtadm
|
iniset $CINDER_CONF DEFAULT iscsi_helper tgtadm
|
||||||
local dburl
|
iniset $CINDER_CONF DEFAULT sql_connection `database_connection_url cinder`
|
||||||
database_connection_url dburl cinder
|
|
||||||
iniset $CINDER_CONF DEFAULT sql_connection $dburl
|
|
||||||
iniset $CINDER_CONF DEFAULT api_paste_config $CINDER_API_PASTE_INI
|
iniset $CINDER_CONF DEFAULT api_paste_config $CINDER_API_PASTE_INI
|
||||||
iniset $CINDER_CONF DEFAULT rootwrap_config "$CINDER_CONF_DIR/rootwrap.conf"
|
iniset $CINDER_CONF DEFAULT rootwrap_config "$CINDER_CONF_DIR/rootwrap.conf"
|
||||||
iniset $CINDER_CONF DEFAULT osapi_volume_extension cinder.api.contrib.standard_extensions
|
iniset $CINDER_CONF DEFAULT osapi_volume_extension cinder.api.contrib.standard_extensions
|
||||||
|
@ -115,9 +115,8 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
function database_connection_url_mysql {
|
function database_connection_url_mysql {
|
||||||
local output=$1
|
local db=$1
|
||||||
local db=$2
|
echo "$BASE_SQL_CONN/$db?charset=utf8"
|
||||||
eval "$output=$BASE_SQL_CONN/$db?charset=utf8"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Restore xtrace
|
# Restore xtrace
|
||||||
|
@ -70,9 +70,8 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
function database_connection_url_postgresql {
|
function database_connection_url_postgresql {
|
||||||
local output=$1
|
local db=$1
|
||||||
local db=$2
|
echo "$BASE_SQL_CONN/$db?client_encoding=utf8"
|
||||||
eval "$output=$BASE_SQL_CONN/$db?client_encoding=utf8"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Restore xtrace
|
# Restore xtrace
|
||||||
|
@ -81,8 +81,7 @@ function configure_glance() {
|
|||||||
cp $GLANCE_DIR/etc/glance-registry.conf $GLANCE_REGISTRY_CONF
|
cp $GLANCE_DIR/etc/glance-registry.conf $GLANCE_REGISTRY_CONF
|
||||||
iniset $GLANCE_REGISTRY_CONF DEFAULT debug True
|
iniset $GLANCE_REGISTRY_CONF DEFAULT debug True
|
||||||
inicomment $GLANCE_REGISTRY_CONF DEFAULT log_file
|
inicomment $GLANCE_REGISTRY_CONF DEFAULT log_file
|
||||||
local dburl
|
local dburl=`database_connection_url glance`
|
||||||
database_connection_url dburl glance
|
|
||||||
iniset $GLANCE_REGISTRY_CONF DEFAULT sql_connection $dburl
|
iniset $GLANCE_REGISTRY_CONF DEFAULT sql_connection $dburl
|
||||||
iniset $GLANCE_REGISTRY_CONF DEFAULT use_syslog $SYSLOG
|
iniset $GLANCE_REGISTRY_CONF DEFAULT use_syslog $SYSLOG
|
||||||
iniset $GLANCE_REGISTRY_CONF paste_deploy flavor keystone
|
iniset $GLANCE_REGISTRY_CONF paste_deploy flavor keystone
|
||||||
|
4
lib/heat
4
lib/heat
@ -117,9 +117,7 @@ function configure_heat() {
|
|||||||
iniset $HEAT_ENGINE_CONF DEFAULT heat_metadata_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT
|
iniset $HEAT_ENGINE_CONF DEFAULT heat_metadata_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT
|
||||||
iniset $HEAT_ENGINE_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1/waitcondition
|
iniset $HEAT_ENGINE_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1/waitcondition
|
||||||
iniset $HEAT_ENGINE_CONF DEFAULT heat_watch_server_url http://$HEAT_API_CW_HOST:$HEAT_API_CW_PORT
|
iniset $HEAT_ENGINE_CONF DEFAULT heat_watch_server_url http://$HEAT_API_CW_HOST:$HEAT_API_CW_PORT
|
||||||
local dburl
|
iniset $HEAT_ENGINE_CONF DEFAULT sql_connection `database_connection_url heat`
|
||||||
database_connection_url dburl heat
|
|
||||||
iniset $HEAT_ENGINE_CONF DEFAULT sql_connection $dburl
|
|
||||||
iniset $HEAT_ENGINE_CONF DEFAULT auth_encryption_key `hexdump -n 16 -v -e '/1 "%02x"' /dev/random`
|
iniset $HEAT_ENGINE_CONF DEFAULT auth_encryption_key `hexdump -n 16 -v -e '/1 "%02x"' /dev/random`
|
||||||
|
|
||||||
iniset_rpc_backend heat $HEAT_ENGINE_CONF DEFAULT
|
iniset_rpc_backend heat $HEAT_ENGINE_CONF DEFAULT
|
||||||
|
@ -91,8 +91,6 @@ function configure_keystone() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Rewrite stock ``keystone.conf``
|
# Rewrite stock ``keystone.conf``
|
||||||
local dburl
|
|
||||||
database_connection_url dburl keystone
|
|
||||||
|
|
||||||
if is_service_enabled ldap; then
|
if is_service_enabled ldap; then
|
||||||
#Set all needed ldap values
|
#Set all needed ldap values
|
||||||
@ -123,7 +121,7 @@ function configure_keystone() {
|
|||||||
|
|
||||||
iniset $KEYSTONE_CONF DEFAULT admin_token "$SERVICE_TOKEN"
|
iniset $KEYSTONE_CONF DEFAULT admin_token "$SERVICE_TOKEN"
|
||||||
iniset $KEYSTONE_CONF signing token_format "$KEYSTONE_TOKEN_FORMAT"
|
iniset $KEYSTONE_CONF signing token_format "$KEYSTONE_TOKEN_FORMAT"
|
||||||
iniset $KEYSTONE_CONF sql connection $dburl
|
iniset $KEYSTONE_CONF sql connection `database_connection_url keystone`
|
||||||
iniset $KEYSTONE_CONF ec2 driver "keystone.contrib.ec2.backends.sql.Ec2"
|
iniset $KEYSTONE_CONF ec2 driver "keystone.contrib.ec2.backends.sql.Ec2"
|
||||||
sed -e "
|
sed -e "
|
||||||
/^pipeline.*ec2_extension crud_/s|ec2_extension crud_extension|ec2_extension s3_extension crud_extension|;
|
/^pipeline.*ec2_extension crud_/s|ec2_extension crud_extension|ec2_extension s3_extension crud_extension|;
|
||||||
|
7
lib/nova
7
lib/nova
@ -377,12 +377,9 @@ function create_nova_conf() {
|
|||||||
iniset $NOVA_CONF DEFAULT s3_port "$S3_SERVICE_PORT"
|
iniset $NOVA_CONF DEFAULT s3_port "$S3_SERVICE_PORT"
|
||||||
iniset $NOVA_CONF DEFAULT osapi_compute_extension "nova.api.openstack.compute.contrib.standard_extensions"
|
iniset $NOVA_CONF DEFAULT osapi_compute_extension "nova.api.openstack.compute.contrib.standard_extensions"
|
||||||
iniset $NOVA_CONF DEFAULT my_ip "$HOST_IP"
|
iniset $NOVA_CONF DEFAULT my_ip "$HOST_IP"
|
||||||
local dburl
|
iniset $NOVA_CONF DEFAULT sql_connection `database_connection_url nova`
|
||||||
database_connection_url dburl nova
|
|
||||||
iniset $NOVA_CONF DEFAULT sql_connection "$dburl"
|
|
||||||
if is_baremetal; then
|
if is_baremetal; then
|
||||||
database_connection_url dburl nova_bm
|
iniset $NOVA_CONF baremetal sql_connection `database_connection_url nova_bm`
|
||||||
iniset $NOVA_CONF baremetal sql_connection $dburl
|
|
||||||
fi
|
fi
|
||||||
iniset $NOVA_CONF DEFAULT libvirt_type "$LIBVIRT_TYPE"
|
iniset $NOVA_CONF DEFAULT libvirt_type "$LIBVIRT_TYPE"
|
||||||
iniset $NOVA_CONF DEFAULT libvirt_cpu_mode "none"
|
iniset $NOVA_CONF DEFAULT libvirt_cpu_mode "none"
|
||||||
|
@ -405,9 +405,7 @@ function _configure_quantum_common() {
|
|||||||
Q_PLUGIN_CONF_FILE=$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME
|
Q_PLUGIN_CONF_FILE=$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME
|
||||||
cp $QUANTUM_DIR/$Q_PLUGIN_CONF_FILE /$Q_PLUGIN_CONF_FILE
|
cp $QUANTUM_DIR/$Q_PLUGIN_CONF_FILE /$Q_PLUGIN_CONF_FILE
|
||||||
|
|
||||||
database_connection_url dburl $Q_DB_NAME
|
iniset /$Q_PLUGIN_CONF_FILE DATABASE sql_connection `database_connection_url $Q_DB_NAME`
|
||||||
iniset /$Q_PLUGIN_CONF_FILE DATABASE sql_connection $dburl
|
|
||||||
unset dburl
|
|
||||||
|
|
||||||
_quantum_setup_rootwrap
|
_quantum_setup_rootwrap
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user