Skip to content

Commit

Permalink
Merge pull request #661 from terraform-providers/b-continue_logging_d…
Browse files Browse the repository at this point in the history
…uring_oldconfig

r/virtual_machine: Continue logging for oldconfig
  • Loading branch information
bill-rich authored Nov 28, 2018
2 parents 1128e55 + 4cf805b commit 18a78e2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions vsphere/virtual_machine_config_structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ package vsphere

import (
"fmt"
"io/ioutil"
"log"
"reflect"

"github.com/hashicorp/terraform/helper/logging"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/hashicorp/terraform/terraform"
Expand Down Expand Up @@ -846,15 +844,13 @@ func expandVirtualMachineConfigSpecChanged(d *schema.ResourceData, client *govmo
// Read state back in. This is necessary to ensure GetChange calls work
// correctly.
oldData = resourceVSphereVirtualMachine().Data(oldData.State())
// Get both specs. Silence the logging for oldSpec to suppress fake
// reboot_required log messages.
log.SetOutput(ioutil.Discard)
// Get both specs.
log.Printf("[DEBUG] %s: Expanding old config. Ignore reboot_required messages", resourceVSphereVirtualMachineIDString(d))
oldSpec, err := expandVirtualMachineConfigSpec(oldData, client)
if err != nil {
return types.VirtualMachineConfigSpec{}, false, err
}

logging.SetOutput()
log.Printf("[DEBUG] %s: Expanding of old config complete", resourceVSphereVirtualMachineIDString(d))

newSpec, err := expandVirtualMachineConfigSpec(d, client)
if err != nil {
Expand Down

0 comments on commit 18a78e2

Please # to comment.