From 946114eb3085ea05dd748402682e9169c2a19d0d Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Sun, 31 Aug 2014 13:49:05 +0200 Subject: [PATCH] labs: pass vm_name as arg to _vbox_configure_ifs _vbox_configure_ifs should no longer use the environment variable NODE_NAME as the name of the node VM. It gets replaced by the correct value passed as an argument. Change-Id: I9d36420bcf56bbabe2f47cee2d7eb2ad824bf5d1 --- labs/lib/osbash/virtualbox.install_node | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/labs/lib/osbash/virtualbox.install_node b/labs/lib/osbash/virtualbox.install_node index e09ce580..f740915d 100644 --- a/labs/lib/osbash/virtualbox.install_node +++ b/labs/lib/osbash/virtualbox.install_node @@ -2,6 +2,7 @@ # Configure VirtualBox network interfaces function _vbox_configure_ifs { + local vm_name=$1 # Iterate over all NET_IF_? variables local net_ifs=( "${!NET_IF_@}" ) local net_if="" @@ -9,13 +10,13 @@ function _vbox_configure_ifs { local if_num=${net_if##*_} if [ "${!net_if}" = "nat" ]; then echo "interface $if_num: NAT" - vm_nic_nat "$NODE_NAME" "$if_num" + vm_nic_nat "$vm_name" "$if_num" else # Host-only network: net_if is net name (e.g. API_NET) # Use corresponding VirtualBox interface (e.g. API_NET_IF) local host_if="${!net_if}_IF" echo "interface $if_num: host-only ${!host_if}" - vm_nic_hostonly "$NODE_NAME" "$if_num" "${!host_if}" + vm_nic_hostonly "$vm_name" "$if_num" "${!host_if}" fi done } @@ -47,7 +48,7 @@ function vm_init_node { # Set VM_CPUS in config/config.NODE_NAME to override vm_cpus "$vm_name" "${VM_CPUS:-1}" - _vbox_configure_ifs + _vbox_configure_ifs "$vm_name" # Port forwarding if [ -n "${VM_SSH_PORT:-}" ]; then