15026: Clean up confusing variable name.
authorTom Clegg <tclegg@veritasgenetics.com>
Mon, 1 Jul 2019 14:55:26 +0000 (10:55 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Mon, 1 Jul 2019 14:55:26 +0000 (10:55 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

lib/cloud/cloudtest/tester.go

index e0a6a3597bd1a2bfaa6fe71db542d4027579a1eb..adc57803f1f9432ad1be1e74065a32d56bbd32b2 100644 (file)
@@ -342,15 +342,18 @@ func (t *tester) destroyTestInstance() bool {
                return true
        }
        for {
-               t.Logger.WithField("Instance", t.testInstance.ID()).Info("destroying instance")
+               lgr := t.Logger.WithField("Instance", t.testInstance.ID())
+               lgr.Info("destroying instance")
                t0 := time.Now()
+
                err := t.testInstance.Destroy()
-               lgr := t.Logger.WithField("Instance", t.testInstance.ID())
-               if lgr := lgr.WithField("Duration", time.Since(t0)); err != nil {
-                       lgr.WithError(err).Error("error destroying instance")
+               lgrDur := lgr.WithField("Duration", time.Since(t0))
+               if err != nil {
+                       lgrDur.WithError(err).Error("error destroying instance")
                } else {
-                       lgr.Info("destroyed instance")
+                       lgrDur.Info("destroyed instance")
                }
+
                err = t.refreshTestInstance()
                if err == errTestInstanceNotFound {
                        lgr.Info("instance no longer appears in list")