From 244639cf3da56c1b3270f97b507b72d673093673 Mon Sep 17 00:00:00 2001 From: James Stremick Date: Mon, 27 Apr 2015 17:26:52 -0400 Subject: [PATCH] Remove some domain checking duplication --- builtin/providers/aws/resource_aws_eip.go | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/builtin/providers/aws/resource_aws_eip.go b/builtin/providers/aws/resource_aws_eip.go index b667b0779..8956ed507 100644 --- a/builtin/providers/aws/resource_aws_eip.go +++ b/builtin/providers/aws/resource_aws_eip.go @@ -108,18 +108,6 @@ func resourceAwsEipRead(d *schema.ResourceData, meta interface{}) error { domain := resourceAwsEipDomain(d) id := d.Id() - var assocIds []*string - var publicIps []*string - if domain == "vpc" { - assocIds = []*string{aws.String(id)} - } else { - publicIps = []*string{aws.String(id)} - } - - log.Printf( - "[DEBUG] EIP describe configuration: %#v, %#v (domain: %s)", - assocIds, publicIps, domain) - req := &ec2.DescribeAddressesInput{} if domain == "vpc" { @@ -128,9 +116,14 @@ func resourceAwsEipRead(d *schema.ResourceData, meta interface{}) error { req.PublicIPs = []*string{aws.String(id)} } + log.Printf( + "[DEBUG] EIP describe configuration: %#v (domain: %s)", + req, domain) + describeAddresses, err := ec2conn.DescribeAddresses(req) if err != nil { if ec2err, ok := err.(aws.APIError); ok && ec2err.Code == "InvalidAllocationID.NotFound" { + log.Printf("[DEBUG] EIP describe configuration: %#v", req) d.SetId("") return nil }