Skip to content

Commit

Permalink
provider/aws: improve iam_policy err msgs
Browse files Browse the repository at this point in the history
Turns out `%s` outputs nicer than `%#v` here.

Closes #2247
  • Loading branch information
phinze committed Jun 8, 2015
1 parent 2becc22 commit 38e096a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions resource_aws_iam_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func resourceAwsIamPolicyCreate(d *schema.ResourceData, meta interface{}) error

response, err := iamconn.CreatePolicy(request)
if err != nil {
return fmt.Errorf("Error creating IAM policy %s: %#v", name, err)
return fmt.Errorf("Error creating IAM policy %s: %s", name, err)
}

return readIamPolicy(d, response.Policy)
Expand All @@ -78,7 +78,7 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error {
d.SetId("")
return nil
}
return fmt.Errorf("Error reading IAM policy %s: %#v", d.Id(), err)
return fmt.Errorf("Error reading IAM policy %s: %s", d.Id(), err)
}

return readIamPolicy(d, response.Policy)
Expand All @@ -101,7 +101,7 @@ func resourceAwsIamPolicyUpdate(d *schema.ResourceData, meta interface{}) error
}

if _, err := iamconn.CreatePolicyVersion(request); err != nil {
return fmt.Errorf("Error updating IAM policy %s: %#v", d.Id(), err)
return fmt.Errorf("Error updating IAM policy %s: %s", d.Id(), err)
}
return nil
}
Expand Down Expand Up @@ -187,7 +187,7 @@ func iamPolicyDeleteVersion(arn, versionID string, iamconn *iam.IAM) error {

_, err := iamconn.DeletePolicyVersion(request)
if err != nil {
return fmt.Errorf("Error deleting version %s from IAM policy %s: %#v", versionID, arn, err)
return fmt.Errorf("Error deleting version %s from IAM policy %s: %s", versionID, arn, err)
}
return nil
}
Expand All @@ -199,7 +199,7 @@ func iamPolicyListVersions(arn string, iamconn *iam.IAM) ([]*iam.PolicyVersion,

response, err := iamconn.ListPolicyVersions(request)
if err != nil {
return nil, fmt.Errorf("Error listing versions for IAM policy %s: %#v", arn, err)
return nil, fmt.Errorf("Error listing versions for IAM policy %s: %s", arn, err)
}
return response.Versions, nil
}
Expand Down

0 comments on commit 38e096a

Please sign in to comment.