Nova: Update compute start script for console
[0] added route command to identify multiple default routes. In some deployments, route command is not available which set the client_interface value incorrectly. In this case VNC clinet tries to connect to default host 127.0.0.1 and fails. [0] https://review.opendev.org/#/c/696187 Change-Id: I4a936af053114988e0b70048e276a71833c5638e
This commit is contained in:
@@ -32,8 +32,12 @@ fi
|
|||||||
|
|
||||||
if [ -z "${client_address}" ] ; then
|
if [ -z "${client_address}" ] ; then
|
||||||
if [ -z "${client_interface}" ] ; then
|
if [ -z "${client_interface}" ] ; then
|
||||||
# search for interface with default routing, if multiple default routes exist then select the one with the lowest metric.
|
if [ -x "$(command -v route)" ] ; then
|
||||||
client_interface=$(route -n | awk '/^0.0.0.0/ { print $5 " " $NF }' | sort | awk '{ print $NF; exit }')
|
# search for interface with default routing, if multiple default routes exist then select the one with the lowest metric.
|
||||||
|
client_interface=$(route -n | awk '/^0.0.0.0/ { print $5 " " $NF }' | sort | awk '{ print $NF; exit }')
|
||||||
|
else
|
||||||
|
client_interface=$(ip r | grep default | awk '{print $5}')
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# determine client ip dynamically based on interface provided
|
# determine client ip dynamically based on interface provided
|
||||||
|
|||||||
@@ -32,8 +32,12 @@ fi
|
|||||||
|
|
||||||
if [ -z "${client_address}" ] ; then
|
if [ -z "${client_address}" ] ; then
|
||||||
if [ -z "${client_interface}" ] ; then
|
if [ -z "${client_interface}" ] ; then
|
||||||
# search for interface with default routing, if multiple default routes exist then select the one with the lowest metric.
|
if [ -x "$(command -v route)" ] ; then
|
||||||
client_interface=$(route -n | awk '/^0.0.0.0/ { print $5 " " $NF }' | sort | awk '{ print $NF; exit }')
|
# search for interface with default routing, if multiple default routes exist then select the one with the lowest metric.
|
||||||
|
client_interface=$(route -n | awk '/^0.0.0.0/ { print $5 " " $NF }' | sort | awk '{ print $NF; exit }')
|
||||||
|
else
|
||||||
|
client_interface=$(ip r | grep default | awk '{print $5}')
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# determine client ip dynamically based on interface provided
|
# determine client ip dynamically based on interface provided
|
||||||
|
|||||||
Reference in New Issue
Block a user