Use public gateway for Trove if neutron is enabled

Fix Trove to use the PUBLIC_NETWORK_GATEWAY if neutron is enabled.
This is needed since in this case the guestagent is able to reach
the devstack host only via the public PUBLIC_NETWORK_GATEWAY and
not via the private NETWORK_GATEWAY.

Change-Id: I61ee707e16d0222e7f479369e769cbe7ef2de7d7
This commit is contained in:
Nikhil Manchanda 2014-05-07 23:46:01 -07:00
parent ceda7cfe65
commit bc22e918d5

View File

@ -21,8 +21,11 @@ set +o xtrace
# Defaults
# --------
NETWORK_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1}
if is_service_enabled neutron; then
TROVE_HOST_GATEWAY=${PUBLIC_NETWORK_GATEWAY:-172.24.4.1}
else
TROVE_HOST_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1}
fi
# Set up default configuration
TROVE_DIR=$DEST/trove
@ -152,7 +155,7 @@ function configure_trove {
iniset $TROVE_CONF_DIR/trove.conf DEFAULT swift_url http://$SERVICE_HOST:8080/v1/AUTH_
iniset $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample DEFAULT rabbit_password $RABBIT_PASSWORD
sed -i "s/localhost/$NETWORK_GATEWAY/g" $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample
sed -i "s/localhost/$TROVE_HOST_GATEWAY/g" $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample
setup_trove_logging $TROVE_CONF_DIR/trove.conf
setup_trove_logging $TROVE_LOCAL_CONF_DIR/trove-guestagent.conf.sample