From 1efd86e8092a335f307f7a0b8c9fcf44840cbf1c Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 31 Oct 2019 15:53:03 +0100 Subject: [PATCH] Linode: remove unused StateTimeout field --- builder/linode/builder_test.go | 37 ---------------------------------- builder/linode/config.go | 7 ------- 2 files changed, 44 deletions(-) diff --git a/builder/linode/builder_test.go b/builder/linode/builder_test.go index 918be6b2c..c80d1c76c 100644 --- a/builder/linode/builder_test.go +++ b/builder/linode/builder_test.go @@ -151,43 +151,6 @@ func TestBuilderPrepare_Image(t *testing.T) { } } -func TestBuilderPrepare_StateTimeout(t *testing.T) { - var b Builder - config := testConfig() - - // Test default - warnings, err := b.Prepare(config) - if len(warnings) > 0 { - t.Fatalf("bad: %#v", warnings) - } - if err != nil { - t.Fatalf("should not have error: %s", err) - } - - // Test set - config["state_timeout"] = "5m" - b = Builder{} - warnings, err = b.Prepare(config) - if len(warnings) > 0 { - t.Fatalf("bad: %#v", warnings) - } - if err != nil { - t.Fatalf("should not have error: %s", err) - } - - // Test bad - config["state_timeout"] = "tubes" - b = Builder{} - warnings, err = b.Prepare(config) - if len(warnings) > 0 { - t.Fatalf("bad: %#v", warnings) - } - if err == nil { - t.Fatal("should have error") - } - -} - func TestBuilderPrepare_ImageLabel(t *testing.T) { var b Builder config := testConfig() diff --git a/builder/linode/config.go b/builder/linode/config.go index 1978d0492..ea8eac073 100644 --- a/builder/linode/config.go +++ b/builder/linode/config.go @@ -9,7 +9,6 @@ import ( "fmt" "os" "regexp" - "time" "github.com/hashicorp/packer/common" "github.com/hashicorp/packer/helper/communicator" @@ -36,8 +35,6 @@ type Config struct { ImageLabel string `mapstructure:"image_label"` Description string `mapstructure:"image_description"` - StateTimeout time.Duration `mapstructure:"state_timeout"` - interCtx interpolate.Context } @@ -100,10 +97,6 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) { } } - if c.StateTimeout == 0 { - c.StateTimeout = 5 * time.Minute - } - if es := c.Comm.Prepare(&c.ctx); len(es) > 0 { errs = packer.MultiErrorAppend(errs, es...) }