From 29dd20da6856fa21d71be2e20e433ce51eaf2714 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Thu, 9 Feb 2017 23:16:40 -0800 Subject: [PATCH] builder/vmware: don't cache ip address so we know if it changes --- builder/vmware/iso/driver_esx5.go | 6 ------ builder/vmware/iso/driver_esx5_test.go | 7 ------- 2 files changed, 13 deletions(-) diff --git a/builder/vmware/iso/driver_esx5.go b/builder/vmware/iso/driver_esx5.go index 4bac820bb..90b7e11b4 100644 --- a/builder/vmware/iso/driver_esx5.go +++ b/builder/vmware/iso/driver_esx5.go @@ -248,12 +248,7 @@ func (d *ESX5Driver) CommHost(state multistep.StateBag) (string, error) { port = sshc.WinRMPort } - if address, ok := state.GetOk("vm_address"); ok { - return address.(string), nil - } - if address := config.CommConfig.Host(); address != "" { - state.Put("vm_address", address) return address, nil } @@ -302,7 +297,6 @@ func (d *ESX5Driver) CommHost(state multistep.StateBag) (string, error) { } else { defer conn.Close() address := record["IPAddress"] - state.Put("vm_address", address) return address, nil } } diff --git a/builder/vmware/iso/driver_esx5_test.go b/builder/vmware/iso/driver_esx5_test.go index de3024718..3b0953f74 100644 --- a/builder/vmware/iso/driver_esx5_test.go +++ b/builder/vmware/iso/driver_esx5_test.go @@ -88,11 +88,4 @@ func TestESX5Driver_CommHost(t *testing.T) { if host != expected_host { t.Errorf("bad host name: %s", host) } - address, ok := state.GetOk("vm_address") - if !ok { - t.Error("state not updated with vm_address") - } - if address.(string) != expected_host { - t.Errorf("bad vm_address: %s", address.(string)) - } }