Remove unused print statements

This commit is contained in:
Alex Clemmer 2018-08-28 15:11:42 -07:00
parent 2fa98a8dad
commit 2baf920c96
2 changed files with 0 additions and 36 deletions

View file

@ -15,16 +15,13 @@
package engine package engine
import ( import (
"bytes"
"context" "context"
"fmt"
"os" "os"
"sync" "sync"
"github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/pulumi/pulumi/pkg/diag" "github.com/pulumi/pulumi/pkg/diag"
"github.com/pulumi/pulumi/pkg/diag/colors"
"github.com/pulumi/pulumi/pkg/resource" "github.com/pulumi/pulumi/pkg/resource"
"github.com/pulumi/pulumi/pkg/resource/deploy" "github.com/pulumi/pulumi/pkg/resource/deploy"
"github.com/pulumi/pulumi/pkg/resource/deploy/providers" "github.com/pulumi/pulumi/pkg/resource/deploy/providers"
@ -277,21 +274,6 @@ func (acts *planActions) OnResourceStepPre(step deploy.Step) (interface{}, error
acts.Opts.Events.resourcePreEvent(step, true /*planning*/, acts.Opts.Debug) acts.Opts.Events.resourcePreEvent(step, true /*planning*/, acts.Opts.Debug)
// Warn the user if they're not updating a resource whose initialization failed.
if step.Op() == deploy.OpSame && len(step.Old().InitErrors) > 0 {
indent := " "
// TODO: Move indentation to the display logic, instead of doing it ourselves.
var warning bytes.Buffer
warning.WriteString("This resource failed to initialize in a previous deployment. It is recommended\n")
warning.WriteString(indent + "to update it to fix these issues:\n")
for i, err := range step.Old().InitErrors {
warning.WriteString(colors.SpecImportant + indent + fmt.Sprintf(" - Problem #%d", i+1) +
colors.Reset + " " + err + "\n")
}
acts.Opts.Diag.Warningf(diag.RawMessage(step.URN(), warning.String()))
}
return nil, nil return nil, nil
} }

View file

@ -15,15 +15,12 @@
package engine package engine
import ( import (
"bytes"
"fmt"
"sync" "sync"
"time" "time"
"github.com/blang/semver" "github.com/blang/semver"
"github.com/pulumi/pulumi/pkg/diag" "github.com/pulumi/pulumi/pkg/diag"
"github.com/pulumi/pulumi/pkg/diag/colors"
"github.com/pulumi/pulumi/pkg/resource" "github.com/pulumi/pulumi/pkg/resource"
"github.com/pulumi/pulumi/pkg/resource/deploy" "github.com/pulumi/pulumi/pkg/resource/deploy"
"github.com/pulumi/pulumi/pkg/resource/plugin" "github.com/pulumi/pulumi/pkg/resource/plugin"
@ -212,21 +209,6 @@ func (acts *updateActions) OnResourceStepPre(step deploy.Step) (interface{}, err
// Check for a default provider step and skip reporting if necessary. // Check for a default provider step and skip reporting if necessary.
if acts.Opts.reportDefaultProviderSteps || !isDefaultProviderStep(step) { if acts.Opts.reportDefaultProviderSteps || !isDefaultProviderStep(step) {
acts.Opts.Events.resourcePreEvent(step, false /*planning*/, acts.Opts.Debug) acts.Opts.Events.resourcePreEvent(step, false /*planning*/, acts.Opts.Debug)
// Warn the user if they're not updating a resource whose initialization failed.
if step.Op() == deploy.OpSame && len(step.Old().InitErrors) > 0 {
indent := " "
// TODO: Move indentation to the display logic, instead of doing it ourselves.
var warning bytes.Buffer
warning.WriteString("This resource failed to initialize in a previous deployment. It is recommended\n")
warning.WriteString(indent + "to update it to fix these issues:\n")
for i, err := range step.Old().InitErrors {
warning.WriteString(colors.SpecImportant + indent + fmt.Sprintf(" - Problem #%d", i+1) +
colors.Reset + " " + err + "\n")
}
acts.Opts.Diag.Warningf(diag.RawMessage(step.URN(), warning.String()))
}
} }
// Inform the snapshot service that we are about to perform a step. // Inform the snapshot service that we are about to perform a step.