builtin/providers/aws: vet fix

Fixes the following vet reports:

builtin/providers/aws/resource_aws_network_acl.go:191: wrong number of args for format in Errorf call: 2 needed but 3 args
builtin/providers/aws/resource_aws_network_acl.go:264: wrong number of args for format in Errorf call: 1 needed but 2 args
builtin/providers/aws/resource_aws_network_acl.go:268: wrong number of args for format in Errorf call: 1 needed but 2 args
builtin/providers/aws/resource_aws_network_acl.go:286: arg m[to_port].(int) for printf verb %s of wrong type: int
builtin/providers/aws/resource_aws_network_acl_test.go:277: arg r.NetworkAcls for printf verb %s of wrong type: []github.com/mitchellh/goamz/ec2.NetworkAcl
builtin/providers/aws/resource_aws_subnet_test.go:21: arg v.MapPublicIpOnLaunch for printf verb %s of wrong type: bool
This commit is contained in:
Emil Hessman 2014-12-17 12:37:42 +01:00
parent 95fa353ee9
commit 4f3f85b165
3 changed files with 9 additions and 9 deletions

View File

@ -188,7 +188,7 @@ func resourceAwsNetworkAclUpdate(d *schema.ResourceData, meta interface{}) error
newSubnet := n.(string)
association, err := findNetworkAclAssociation(newSubnet, ec2conn)
if err != nil {
return fmt.Errorf("Failed to update acl %s with subnet %s: ", d.Id(), newSubnet, err)
return fmt.Errorf("Failed to update acl %s with subnet %s: %s", d.Id(), newSubnet, err)
}
_, err = ec2conn.ReplaceNetworkAclAssociation(association.NetworkAclAssociationId, d.Id())
if err != nil {
@ -221,7 +221,7 @@ func updateNetworkAclEntries(d *schema.ResourceData, entryType string, ec2conn *
ns := n.(*schema.Set)
toBeDeleted, err := expandNetworkAclEntries(os.Difference(ns).List(), entryType)
if(err != nil){
if err != nil {
return err
}
for _, remove := range toBeDeleted {
@ -233,7 +233,7 @@ func updateNetworkAclEntries(d *schema.ResourceData, entryType string, ec2conn *
}
toBeCreated, err := expandNetworkAclEntries(ns.Difference(os).List(), entryType)
if(err != nil){
if err != nil {
return err
}
for _, add := range toBeCreated {
@ -261,11 +261,11 @@ func resourceAwsNetworkAclDelete(d *schema.ResourceData, meta interface{}) error
// This means the subnet is attached to default acl of vpc.
association, err := findNetworkAclAssociation(d.Get("subnet_id").(string), ec2conn)
if err != nil {
return fmt.Errorf("Depedency voilation: Can not delete acl: %s", d.Id(), err)
return fmt.Errorf("Dependency violation: Cannot delete acl %s: %s", d.Id(), err)
}
defaultAcl, err := getDefaultNetworkAcl(d.Get("vpc_id").(string), ec2conn)
if err != nil {
return fmt.Errorf("Depedency voilation: Can not delete acl %s", d.Id(), err)
return fmt.Errorf("Dependency violation: Cannot delete acl %s: %s", d.Id(), err)
}
_, err = ec2conn.ReplaceNetworkAclAssociation(association.NetworkAclAssociationId, defaultAcl.NetworkAclId)
return resource.RetryError{err}
@ -283,7 +283,7 @@ func resourceAwsNetworkAclEntryHash(v interface{}) int {
var buf bytes.Buffer
m := v.(map[string]interface{})
buf.WriteString(fmt.Sprintf("%d-", m["from_port"].(int)))
buf.WriteString(fmt.Sprintf("%s-", m["to_port"].(int)))
buf.WriteString(fmt.Sprintf("%d-", m["to_port"].(int)))
buf.WriteString(fmt.Sprintf("%d-", m["rule_no"].(int)))
buf.WriteString(fmt.Sprintf("%s-", m["action"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["protocol"].(string)))

View File

@ -274,7 +274,7 @@ func testAccCheckSubnetIsAssociatedWithAcl(acl string, sub string) resource.Test
}
r, _ := conn.NetworkAcls([]string{}, ec2.NewFilter())
fmt.Printf("\n\nall acls\n %s\n\n", r.NetworkAcls)
fmt.Printf("\n\nall acls\n %#v\n\n", r.NetworkAcls)
conn.NetworkAcls([]string{}, filter)
return fmt.Errorf("Network Acl %s is not associated with subnet %s", acl, sub)

View File

@ -18,7 +18,7 @@ func TestAccAWSSubnet(t *testing.T) {
}
if v.MapPublicIpOnLaunch != true {
return fmt.Errorf("bad MapPublicIpOnLaunch: %s", v.MapPublicIpOnLaunch)
return fmt.Errorf("bad MapPublicIpOnLaunch: %t", v.MapPublicIpOnLaunch)
}
return nil