[docker_image_ctl.j2] skip hostname update if is up to date (#3529)

Signed-off-by: Stepan Blyschak <stepanb@mellanox.com>
This commit is contained in:
Stepan Blyshchak 2019-10-02 06:48:03 +03:00 committed by Joe LeVeque
parent abc02a702e
commit 52e35a0f95

View File

@ -185,7 +185,10 @@ start() {
{%- endif %}
preStartAction
docker start {{docker_container_name}}
updateHostName "$HOSTNAME"
CURRENT_HOSTNAME="$(docker exec {{docker_container_name}} hostname)"
if [ x"$HOSTNAME" != x"$CURRENT_HOSTNAME" ]; then
updateHostName "$HOSTNAME"
fi
postStartAction
exit $?
fi