Skip to content

Commit

Permalink
Strip 'sdk' suffix from methods; it's a remnant
Browse files Browse the repository at this point in the history
  • Loading branch information
catsby committed May 12, 2015
1 parent 372908c commit f7b6b6b
Show file tree
Hide file tree
Showing 24 changed files with 63 additions and 63 deletions.
6 changes: 3 additions & 3 deletions builtin/providers/aws/resource_aws_customer_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func resourceAwsCustomerGatewayCreate(d *schema.ResourceData, meta interface{})
}

// Create tags.
if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
}

Expand Down Expand Up @@ -147,7 +147,7 @@ func resourceAwsCustomerGatewayRead(d *schema.ResourceData, meta interface{}) er
d.Set("bgp_asn", customerGateway.BGPASN)
d.Set("ip_address", customerGateway.IPAddress)
d.Set("type", customerGateway.Type)
d.Set("tags", tagsToMapSDK(customerGateway.Tags))
d.Set("tags", tagsToMap(customerGateway.Tags))

return nil
}
Expand All @@ -156,7 +156,7 @@ func resourceAwsCustomerGatewayUpdate(d *schema.ResourceData, meta interface{})
conn := meta.(*AWSClient).ec2conn

// Update tags if required.
if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
}

Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/aws/resource_aws_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ func resourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error {
d.Set("subnet_id", instance.SubnetID)
}
d.Set("ebs_optimized", instance.EBSOptimized)
d.Set("tags", tagsToMapSDK(instance.Tags))
d.Set("tags", tagsToMap(instance.Tags))

// Determine whether we're referring to security groups with
// IDs or names. We use a heuristic to figure this out. By default,
Expand Down Expand Up @@ -700,7 +700,7 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error {
// TODO(mitchellh): wait for the attributes we modified to
// persist the change...

if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
} else {
d.SetPartial("tags")
Expand Down
8 changes: 4 additions & 4 deletions builtin/providers/aws/resource_aws_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,18 +334,18 @@ func TestAccAWSInstance_tags(t *testing.T) {
Config: testAccCheckInstanceConfigTags,
Check: resource.ComposeTestCheckFunc(
testAccCheckInstanceExists("aws_instance.foo", &v),
testAccCheckTagsSDK(&v.Tags, "foo", "bar"),
testAccCheckTags(&v.Tags, "foo", "bar"),
// Guard against regression of https://github.com/hashicorp/terraform/issues/914
testAccCheckTagsSDK(&v.Tags, "#", ""),
testAccCheckTags(&v.Tags, "#", ""),
),
},

resource.TestStep{
Config: testAccCheckInstanceConfigTagsUpdate,
Check: resource.ComposeTestCheckFunc(
testAccCheckInstanceExists("aws_instance.foo", &v),
testAccCheckTagsSDK(&v.Tags, "foo", ""),
testAccCheckTagsSDK(&v.Tags, "bar", "baz"),
testAccCheckTags(&v.Tags, "foo", ""),
testAccCheckTags(&v.Tags, "bar", "baz"),
),
},
},
Expand Down
6 changes: 3 additions & 3 deletions builtin/providers/aws/resource_aws_internet_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func resourceAwsInternetGatewayCreate(d *schema.ResourceData, meta interface{})
d.SetId(*ig.InternetGatewayID)
log.Printf("[INFO] InternetGateway ID: %s", d.Id())

err = setTagsSDK(conn, d)
err = setTags(conn, d)
if err != nil {
return err
}
Expand Down Expand Up @@ -73,7 +73,7 @@ func resourceAwsInternetGatewayRead(d *schema.ResourceData, meta interface{}) er
d.Set("vpc_id", ig.Attachments[0].VPCID)
}

d.Set("tags", tagsToMapSDK(ig.Tags))
d.Set("tags", tagsToMap(ig.Tags))

return nil
}
Expand All @@ -93,7 +93,7 @@ func resourceAwsInternetGatewayUpdate(d *schema.ResourceData, meta interface{})

conn := meta.(*AWSClient).ec2conn

if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
}

Expand Down
6 changes: 3 additions & 3 deletions builtin/providers/aws/resource_aws_internet_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ func TestAccAWSInternetGateway_tags(t *testing.T) {
Config: testAccCheckInternetGatewayConfigTags,
Check: resource.ComposeTestCheckFunc(
testAccCheckInternetGatewayExists("aws_internet_gateway.foo", &v),
testAccCheckTagsSDK(&v.Tags, "foo", "bar"),
testAccCheckTags(&v.Tags, "foo", "bar"),
),
},

resource.TestStep{
Config: testAccCheckInternetGatewayConfigTagsUpdate,
Check: resource.ComposeTestCheckFunc(
testAccCheckInternetGatewayExists("aws_internet_gateway.foo", &v),
testAccCheckTagsSDK(&v.Tags, "foo", ""),
testAccCheckTagsSDK(&v.Tags, "bar", "baz"),
testAccCheckTags(&v.Tags, "foo", ""),
testAccCheckTags(&v.Tags, "bar", "baz"),
),
},
},
Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/aws/resource_aws_network_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func resourceAwsNetworkAclRead(d *schema.ResourceData, meta interface{}) error {
}

d.Set("vpc_id", networkAcl.VPCID)
d.Set("tags", tagsToMapSDK(networkAcl.Tags))
d.Set("tags", tagsToMap(networkAcl.Tags))

if err := d.Set("ingress", networkAclEntriesToMapList(ingressEntries)); err != nil {
return err
Expand Down Expand Up @@ -213,7 +213,7 @@ func resourceAwsNetworkAclUpdate(d *schema.ResourceData, meta interface{}) error
}
}

if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
} else {
d.SetPartial("tags")
Expand Down
2 changes: 1 addition & 1 deletion builtin/providers/aws/resource_aws_network_acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func TestAccAWSNetworkAcl_OnlyEgressRules(t *testing.T) {
Config: testAccAWSNetworkAclEgressConfig,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSNetworkAclExists("aws_network_acl.bond", &networkAcl),
testAccCheckTagsSDK(&networkAcl.Tags, "foo", "bar"),
testAccCheckTags(&networkAcl.Tags, "foo", "bar"),
),
},
},
Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/aws/resource_aws_network_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func resourceAwsNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) e
d.Set("security_groups", flattenGroupIdentifiers(eni.Groups))

// Tags
d.Set("tags", tagsToMapSDK(eni.TagSet))
d.Set("tags", tagsToMap(eni.TagSet))

if eni.Attachment != nil {
attachment := []map[string]interface{}{flattenAttachment(eni.Attachment)}
Expand Down Expand Up @@ -226,7 +226,7 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{})
d.SetPartial("security_groups")
}

if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
} else {
d.SetPartial("tags")
Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/aws/resource_aws_route_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func resourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error {
d.Set("route", route)

// Tags
d.Set("tags", tagsToMapSDK(rt.Tags))
d.Set("tags", tagsToMap(rt.Tags))

return nil
}
Expand Down Expand Up @@ -289,7 +289,7 @@ func resourceAwsRouteTableUpdate(d *schema.ResourceData, meta interface{}) error
}
}

if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
} else {
d.SetPartial("tags")
Expand Down
6 changes: 3 additions & 3 deletions builtin/providers/aws/resource_aws_route_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,16 @@ func TestAccAWSRouteTable_tags(t *testing.T) {
Config: testAccRouteTableConfigTags,
Check: resource.ComposeTestCheckFunc(
testAccCheckRouteTableExists("aws_route_table.foo", &route_table),
testAccCheckTagsSDK(&route_table.Tags, "foo", "bar"),
testAccCheckTags(&route_table.Tags, "foo", "bar"),
),
},

resource.TestStep{
Config: testAccRouteTableConfigTagsUpdate,
Check: resource.ComposeTestCheckFunc(
testAccCheckRouteTableExists("aws_route_table.foo", &route_table),
testAccCheckTagsSDK(&route_table.Tags, "foo", ""),
testAccCheckTagsSDK(&route_table.Tags, "bar", "baz"),
testAccCheckTags(&route_table.Tags, "foo", ""),
testAccCheckTags(&route_table.Tags, "bar", "baz"),
),
},
},
Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/aws/resource_aws_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func resourceAwsSecurityGroupRead(d *schema.ResourceData, meta interface{}) erro
d.Set("owner_id", sg.OwnerID)
d.Set("ingress", ingressRules)
d.Set("egress", egressRules)
d.Set("tags", tagsToMapSDK(sg.Tags))
d.Set("tags", tagsToMap(sg.Tags))
return nil
}

Expand Down Expand Up @@ -281,7 +281,7 @@ func resourceAwsSecurityGroupUpdate(d *schema.ResourceData, meta interface{}) er
}
}

if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
}

Expand Down
6 changes: 3 additions & 3 deletions builtin/providers/aws/resource_aws_security_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,16 +428,16 @@ func TestAccAWSSecurityGroup_tags(t *testing.T) {
Config: testAccAWSSecurityGroupConfigTags,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSSecurityGroupExists("aws_security_group.foo", &group),
testAccCheckTagsSDK(&group.Tags, "foo", "bar"),
testAccCheckTags(&group.Tags, "foo", "bar"),
),
},

resource.TestStep{
Config: testAccAWSSecurityGroupConfigTagsUpdate,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSSecurityGroupExists("aws_security_group.foo", &group),
testAccCheckTagsSDK(&group.Tags, "foo", ""),
testAccCheckTagsSDK(&group.Tags, "bar", "baz"),
testAccCheckTags(&group.Tags, "foo", ""),
testAccCheckTags(&group.Tags, "bar", "baz"),
),
},
},
Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/aws/resource_aws_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func resourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error {
d.Set("availability_zone", subnet.AvailabilityZone)
d.Set("cidr_block", subnet.CIDRBlock)
d.Set("map_public_ip_on_launch", subnet.MapPublicIPOnLaunch)
d.Set("tags", tagsToMapSDK(subnet.Tags))
d.Set("tags", tagsToMap(subnet.Tags))

return nil
}
Expand All @@ -125,7 +125,7 @@ func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error {

d.Partial(true)

if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
} else {
d.SetPartial("tags")
Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/aws/resource_aws_vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error {
d.Set("dhcp_options_id", vpc.DHCPOptionsID)

// Tags
d.Set("tags", tagsToMapSDK(vpc.Tags))
d.Set("tags", tagsToMap(vpc.Tags))

// Attributes
attribute := "enableDnsSupport"
Expand Down Expand Up @@ -229,7 +229,7 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error {
d.SetPartial("enable_dns_support")
}

if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
} else {
d.SetPartial("tags")
Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/aws/resource_aws_vpc_dhcp_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func resourceAwsVpcDhcpOptionsRead(d *schema.ResourceData, meta interface{}) err
}

opts := resp.DHCPOptions[0]
d.Set("tags", tagsToMapSDK(opts.Tags))
d.Set("tags", tagsToMap(opts.Tags))

for _, cfg := range opts.DHCPConfigurations {
tfKey := strings.Replace(*cfg.Key, "-", "_", -1)
Expand All @@ -173,7 +173,7 @@ func resourceAwsVpcDhcpOptionsRead(d *schema.ResourceData, meta interface{}) err

func resourceAwsVpcDhcpOptionsUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ec2conn
return setTagsSDK(conn, d)
return setTags(conn, d)
}

func resourceAwsVpcDhcpOptionsDelete(d *schema.ResourceData, meta interface{}) error {
Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/aws/resource_aws_vpc_peering_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func resourceAwsVPCPeeringRead(d *schema.ResourceData, meta interface{}) error {
d.Set("peer_owner_id", pc.AccepterVPCInfo.OwnerID)
d.Set("peer_vpc_id", pc.AccepterVPCInfo.VPCID)
d.Set("vpc_id", pc.RequesterVPCInfo.VPCID)
d.Set("tags", tagsToMapSDK(pc.Tags))
d.Set("tags", tagsToMap(pc.Tags))

return nil
}
Expand All @@ -125,7 +125,7 @@ func resourceVPCPeeringConnectionAccept(conn *ec2.EC2, id string) (string, error
func resourceAwsVPCPeeringUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*AWSClient).ec2conn

if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
} else {
d.SetPartial("tags")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestAccAWSVPCPeeringConnection_tags(t *testing.T) {
Config: testAccVpcPeeringConfigTags,
Check: resource.ComposeTestCheckFunc(
testAccCheckAWSVpcPeeringConnectionExists("aws_vpc_peering_connection.foo", &connection),
testAccCheckTagsSDK(&connection.Tags, "foo", "bar"),
testAccCheckTags(&connection.Tags, "foo", "bar"),
),
},
},
Expand Down
6 changes: 3 additions & 3 deletions builtin/providers/aws/resource_aws_vpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ func TestAccVpc_tags(t *testing.T) {
testAccCheckVpcCidr(&vpc, "10.1.0.0/16"),
resource.TestCheckResourceAttr(
"aws_vpc.foo", "cidr_block", "10.1.0.0/16"),
testAccCheckTagsSDK(&vpc.Tags, "foo", "bar"),
testAccCheckTags(&vpc.Tags, "foo", "bar"),
),
},

resource.TestStep{
Config: testAccVpcConfigTagsUpdate,
Check: resource.ComposeTestCheckFunc(
testAccCheckVpcExists("aws_vpc.foo", &vpc),
testAccCheckTagsSDK(&vpc.Tags, "foo", ""),
testAccCheckTagsSDK(&vpc.Tags, "bar", "baz"),
testAccCheckTags(&vpc.Tags, "foo", ""),
testAccCheckTags(&vpc.Tags, "bar", "baz"),
),
},
},
Expand Down
6 changes: 3 additions & 3 deletions builtin/providers/aws/resource_aws_vpn_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func resourceAwsVpnConnectionCreate(d *schema.ResourceData, meta interface{}) er
}

// Create tags.
if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
}

Expand Down Expand Up @@ -243,7 +243,7 @@ func resourceAwsVpnConnectionRead(d *schema.ResourceData, meta interface{}) erro
d.Set("vpn_gateway_id", vpnConnection.VPNGatewayID)
d.Set("customer_gateway_id", vpnConnection.CustomerGatewayID)
d.Set("type", vpnConnection.Type)
d.Set("tags", tagsToMapSDK(vpnConnection.Tags))
d.Set("tags", tagsToMap(vpnConnection.Tags))

if vpnConnection.Options != nil {
if err := d.Set("static_routes_only", vpnConnection.Options.StaticRoutesOnly); err != nil {
Expand All @@ -269,7 +269,7 @@ func resourceAwsVpnConnectionUpdate(d *schema.ResourceData, meta interface{}) er
conn := meta.(*AWSClient).ec2conn

// Update tags if required.
if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
}

Expand Down
4 changes: 2 additions & 2 deletions builtin/providers/aws/resource_aws_vpn_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func resourceAwsVpnGatewayRead(d *schema.ResourceData, meta interface{}) error {
d.Set("vpc_id", vpnGateway.VPCAttachments[0].VPCID)
}
d.Set("availability_zone", vpnGateway.AvailabilityZone)
d.Set("tags", tagsToMapSDK(vpnGateway.Tags))
d.Set("tags", tagsToMap(vpnGateway.Tags))

return nil
}
Expand All @@ -109,7 +109,7 @@ func resourceAwsVpnGatewayUpdate(d *schema.ResourceData, meta interface{}) error

conn := meta.(*AWSClient).ec2conn

if err := setTagsSDK(conn, d); err != nil {
if err := setTags(conn, d); err != nil {
return err
}

Expand Down
Loading

0 comments on commit f7b6b6b

Please sign in to comment.