Nova: (fix bug) get ip address from interface

Some environment which is enabled zeroconf network, it returns
multilines. This PS make to get the one ip address correctly.

Change-Id: I577f02908b76b280d8fa87acec25d96c3f556e47
This commit is contained in:
Jawon Choo 2018-08-09 20:25:13 +09:00
parent fbfcb51c31
commit 90c2a2273e

View File

@ -27,7 +27,7 @@ chown ${NOVA_USER_UID} /var/lib/nova /var/lib/nova/instances
migration_interface="{{- .Values.conf.libvirt.live_migration_interface -}}"
if [[ -n $migration_interface ]]; then
# determine ip dynamically based on interface provided
migration_address=$(ip r | grep $migration_interface | grep -v default | awk '{print $9}')
migration_address=$(ip a s $migration_interface | grep 'inet ' | awk '{print $2}' | awk -F "/" '{print $1}')
fi
touch /tmp/pod-shared/nova-libvirt.conf