Skip to content

Commit

Permalink
Merge "mitaka: provisioning changes"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed May 23, 2016
2 parents 1318e53 + a439d17 commit dd4e2e8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions contrail_provisioning/config/scripts/quantum-server-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ if [ -d /etc/neutron ]; then
PYDIST=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
openstack-config --set /etc/neutron/neutron.conf DEFAULT core_plugin neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2
openstack-config --set /etc/neutron/neutron.conf DEFAULT rabbit_hosts $AMQP_SERVER
liberty_ubuntu=0
ubuntu_liberty_and_above=0
if [ $is_ubuntu -eq 1 ] ; then
neutron_server_version=`dpkg -l | grep 'ii' | grep neutron-server | awk '{print $3}'`
if [[ $neutron_server_version == *"7.0."* ]]; then
liberty_ubuntu=1
if [[ $neutron_server_version == *".0.0"* ]]; then
ubuntu_liberty_and_above=1
fi
fi

if [ $is_ubuntu -eq 1 ] ; then
if [ $liberty_ubuntu -eq 1 ] ; then
if [ $ubuntu_liberty_and_above -eq 1 ] ; then
# for liberty loadbalanacer plugin would be V2 by default and
# neutron_lbaas extensions would be needed in api_extensions_path
openstack-config --set /etc/neutron/neutron.conf DEFAULT api_extensions_path extensions:${PYDIST}/neutron_plugin_contrail/extensions:${PYDIST}/neutron_lbaas/extensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,18 @@ keystone user-role-add --tenant-id $SERVICE_TENANT \
--role-id $ADMIN_ROLE
fi

ubuntu_liberty=0
ubuntu_liberty_and_above=0
if [ $is_ubuntu -eq 1 ]; then
if [[ $keystone_version == *"8.0.0"* ]]; then
ubuntu_liberty=1
if [[ $keystone_version == *".0.0"* ]]; then
ubuntu_liberty_and_above=1
fi
fi

source /etc/contrail/openstackrc

if [[ -n "$ENABLE_ENDPOINTS" ]]; then
if [ -z $(endpoint_lookup $NOVA_SERVICE) ]; then
if [ $ubuntu_liberty -eq 1 ]; then
if [ $ubuntu_liberty_and_above -eq 1 ]; then
openstack endpoint create --region $OS_REGION_NAME $NOVA_SERVICE \
--publicurl http://$CONTROLLER:8774/v1.1/%\(tenant_id\)s \
--adminurl http://$CONTROLLER:8774/v1.1/%\(tenant_id\)s \
Expand Down Expand Up @@ -258,7 +258,7 @@ if [[ -n "$ENABLE_ENDPOINTS" ]]; then
fi
fi

if [ $ubuntu_liberty -eq 1 ]; then
if [ $ubuntu_liberty_and_above -eq 1 ]; then
BARBICAN_SERVICE=$(get_service barbican key-manager "Barbican Service")
BARBICAN_USER=$(get_service_user barbican)

Expand Down
20 changes: 10 additions & 10 deletions contrail_provisioning/openstack/scripts/keystone-server-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,25 +174,25 @@ while [ $tries -lt 10 ]; do
done

if [ $is_ubuntu -eq 1 ] ; then
ubuntu_kilo_or_above=0
ubuntu_liberty_or_above=0
if [[ $keystone_version == *":"* ]]; then
keystone_version_without_epoch=`echo $keystone_version | cut -d':' -f2`
else
keystone_version_without_epoch=`echo $keystone_version`
fi
dpkg --compare-versions $keystone_version_without_epoch ge 2015
if [ $? -eq 0 ]; then
ubuntu_kilo_or_above=1
ubuntu_liberty_or_above=1
else
# starting liberty package versioning is changed to x.y.z from 2015.x.y
if [[ $keystone_version_without_epoch == *"8.0.0"* ]]; then
ubuntu_kilo_or_above=1
if [[ $keystone_version_without_epoch == *".0.0"* ]]; then
ubuntu_liberty_or_above=1
else
ubuntu_kilo_or_above=0
ubuntu_liberty_or_above=0
fi
fi
else
is_kilo_or_above=$(python -c "from distutils.version import LooseVersion; \
is_liberty_or_above=$(python -c "from distutils.version import LooseVersion; \
print LooseVersion('$keystone_version') >= LooseVersion('2015.1.1')")
fi

Expand All @@ -209,14 +209,14 @@ for svc in keystone; do
openstack-config --set /etc/$svc/$svc.conf identity driver keystone.identity.backends.sql.Identity

if [ $is_ubuntu -eq 1 ] ; then
if [ $ubuntu_kilo_or_above -eq 1 ] ; then
if [ $ubuntu_liberty_or_above -eq 1 ] ; then
openstack-config --set /etc/$svc/$svc.conf token driver keystone.token.persistence.backends.memcache.Token
else
openstack-config --set /etc/$svc/$svc.conf token driver keystone.token.backends.memcache.Token
fi
else
# For Kilo openstack release, set keystone.token.persistence.backends.memcache.Token
if [ "$is_kilo_or_above" == "True" ]; then
if [ "$is_liberty_or_above" == "True" ]; then
openstack-config --set /etc/$svc/$svc.conf token driver keystone.token.persistence.backends.memcache.Token
else
openstack-config --set /etc/$svc/$svc.conf token driver keystone.token.backends.memcache.Token
Expand All @@ -237,13 +237,13 @@ if [ "$INTERNAL_VIP" != "none" ]; then
# Openstack HA specific config
openstack-config --set /etc/keystone/keystone.conf database connection mysql://keystone:$SERVICE_DBPASS@$CONTROLLER:3306/keystone
if [ $is_ubuntu -eq 1 ] ; then
if [ $ubuntu_kilo_or_above -eq 1 ] ; then
if [ $ubuntu_liberty_or_above -eq 1 ] ; then
openstack-config --set /etc/$svc/$svc.conf token driver keystone.token.persistence.backends.sql.Token
else
openstack-config --set /etc/$svc/$svc.conf token driver keystone.token.backends.sql.Token
fi
else
if [ "$is_kilo_or_above" == "True" ]; then
if [ "$is_liberty_or_above" == "True" ]; then
openstack-config --set /etc/$svc/$svc.conf token driver keystone.token.persistence.backends.sql.Token
else
openstack-config --set /etc/$svc/$svc.conf token driver keystone.token.backends.sql.Token
Expand Down

0 comments on commit dd4e2e8

Please sign in to comment.