From 964b149df2ebbb027f42e837712efb62ff069c0a Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Fri, 25 Jan 2019 13:03:14 +0100 Subject: [PATCH] aws: remove now unused AccessConfig.metadataRegion --- builder/amazon/common/access_config.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/builder/amazon/common/access_config.go b/builder/amazon/common/access_config.go index 707b7a5ba..9aa694840 100644 --- a/builder/amazon/common/access_config.go +++ b/builder/amazon/common/access_config.go @@ -6,12 +6,10 @@ import ( "log" "net/http" "strings" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ec2/ec2iface" @@ -127,19 +125,6 @@ func (c *AccessConfig) IsChinaCloud() bool { return strings.HasPrefix(c.SessionRegion(), "cn-") } -// metadataRegion returns the region from the metadata service -func (c *AccessConfig) metadataRegion() (string, error) { - - client := cleanhttp.DefaultClient() - - // Keep the default timeout (100ms) low as we don't want to wait in non-EC2 environments - client.Timeout = 100 * time.Millisecond - ec2meta := ec2metadata.New(session.New(), &aws.Config{ - HTTPClient: client, - }) - return ec2meta.Region() -} - func (c *AccessConfig) Prepare(ctx *interpolate.Context) []error { var errs []error