Merge pull request #688 from ceh/yavf

yet another vet fix round
This commit is contained in:
Sander van Harmelen 2014-12-17 13:10:05 +01:00
commit 54e558af82
7 changed files with 14 additions and 14 deletions

View File

@ -138,7 +138,7 @@ func resourceArtifactRead(d *schema.ResourceData, meta interface{}) error {
} else if len(vs) > 1 { } else if len(vs) > 1 {
return fmt.Errorf( return fmt.Errorf(
"Got %d results for '%s/%s', only one is allowed", "Got %d results for '%s/%s', only one is allowed",
user, name, len(vs)) len(vs), user, name)
} }
v := vs[0] v := vs[0]

View File

@ -188,7 +188,7 @@ func resourceAwsNetworkAclUpdate(d *schema.ResourceData, meta interface{}) error
newSubnet := n.(string) newSubnet := n.(string)
association, err := findNetworkAclAssociation(newSubnet, ec2conn) association, err := findNetworkAclAssociation(newSubnet, ec2conn)
if err != nil { 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()) _, err = ec2conn.ReplaceNetworkAclAssociation(association.NetworkAclAssociationId, d.Id())
if err != nil { if err != nil {
@ -219,9 +219,9 @@ func updateNetworkAclEntries(d *schema.ResourceData, entryType string, ec2conn *
os := o.(*schema.Set) os := o.(*schema.Set)
ns := n.(*schema.Set) ns := n.(*schema.Set)
toBeDeleted, err := expandNetworkAclEntries(os.Difference(ns).List(), entryType) toBeDeleted, err := expandNetworkAclEntries(os.Difference(ns).List(), entryType)
if(err != nil){ if err != nil {
return err return err
} }
for _, remove := range toBeDeleted { for _, remove := range toBeDeleted {
@ -233,7 +233,7 @@ func updateNetworkAclEntries(d *schema.ResourceData, entryType string, ec2conn *
} }
toBeCreated, err := expandNetworkAclEntries(ns.Difference(os).List(), entryType) toBeCreated, err := expandNetworkAclEntries(ns.Difference(os).List(), entryType)
if(err != nil){ if err != nil {
return err return err
} }
for _, add := range toBeCreated { 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. // This means the subnet is attached to default acl of vpc.
association, err := findNetworkAclAssociation(d.Get("subnet_id").(string), ec2conn) association, err := findNetworkAclAssociation(d.Get("subnet_id").(string), ec2conn)
if err != nil { 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) defaultAcl, err := getDefaultNetworkAcl(d.Get("vpc_id").(string), ec2conn)
if err != nil { 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) _, err = ec2conn.ReplaceNetworkAclAssociation(association.NetworkAclAssociationId, defaultAcl.NetworkAclId)
return resource.RetryError{err} return resource.RetryError{err}
@ -283,7 +283,7 @@ func resourceAwsNetworkAclEntryHash(v interface{}) int {
var buf bytes.Buffer var buf bytes.Buffer
m := v.(map[string]interface{}) m := v.(map[string]interface{})
buf.WriteString(fmt.Sprintf("%d-", m["from_port"].(int))) 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("%d-", m["rule_no"].(int)))
buf.WriteString(fmt.Sprintf("%s-", m["action"].(string))) buf.WriteString(fmt.Sprintf("%s-", m["action"].(string)))
buf.WriteString(fmt.Sprintf("%s-", m["protocol"].(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()) 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) conn.NetworkAcls([]string{}, filter)
return fmt.Errorf("Network Acl %s is not associated with subnet %s", acl, sub) 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 { if v.MapPublicIpOnLaunch != true {
return fmt.Errorf("bad MapPublicIpOnLaunch: %s", v.MapPublicIpOnLaunch) return fmt.Errorf("bad MapPublicIpOnLaunch: %t", v.MapPublicIpOnLaunch)
} }
return nil return nil

View File

@ -189,13 +189,13 @@ func resourceHerokuOrgAppCreate(d *schema.ResourceData, meta interface{}) error
if v := d.Get("organization.0.personal"); v != nil { if v := d.Get("organization.0.personal"); v != nil {
vs := v.(bool) vs := v.(bool)
log.Printf("[DEBUG] Organization Personal: %s", vs) log.Printf("[DEBUG] Organization Personal: %t", vs)
opts.Personal = &vs opts.Personal = &vs
} }
if v := d.Get("organization.0.locked"); v != nil { if v := d.Get("organization.0.locked"); v != nil {
vs := v.(bool) vs := v.(bool)
log.Printf("[DEBUG] Organization locked: %s", vs) log.Printf("[DEBUG] Organization locked: %t", vs)
opts.Locked = &vs opts.Locked = &vs
} }

View File

@ -70,7 +70,7 @@ func testAccCheckMailgunDomainAttributes(DomainResp *mailgun.DomainResponse) res
} }
if DomainResp.Domain.Wildcard != true { if DomainResp.Domain.Wildcard != true {
return fmt.Errorf("Bad wildcard: %s", DomainResp.Domain.Wildcard) return fmt.Errorf("Bad wildcard: %t", DomainResp.Domain.Wildcard)
} }
if DomainResp.Domain.SmtpPassword != "foobar" { if DomainResp.Domain.SmtpPassword != "foobar" {

View File

@ -162,7 +162,7 @@ func (c *RemoteCommand) disableRemoteState() int {
} }
defer fh.Close() defer fh.Close()
if err := terraform.WriteState(local, fh); err != nil { if err := terraform.WriteState(local, fh); err != nil {
c.Ui.Error(fmt.Sprintf("Failed to encode state file: %v", c.Ui.Error(fmt.Sprintf("Failed to encode state file '%s': %v",
c.conf.statePath, err)) c.conf.statePath, err))
return 1 return 1
} }