Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: Fix Read of AWS CloudWatch Log when Update was called #6384

Merged
merged 1 commit into from
Apr 27, 2016

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Apr 27, 2016

Fixes #6169

The Update func was hitting a return err and when the err was empty, it
was skipping over the subsequent read func

ake testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSCloudWatchLogGroup' 2>~/tf.log
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSCloudWatchLogGroup -timeout 120m
=== RUN   TestAccAWSCloudWatchLogGroup_basic
--- PASS: TestAccAWSCloudWatchLogGroup_basic (14.64s)
=== RUN   TestAccAWSCloudWatchLogGroup_retentionPolicy
--- PASS: TestAccAWSCloudWatchLogGroup_retentionPolicy (23.51s)
=== RUN   TestAccAWSCloudWatchLogGroup_multiple
--- PASS: TestAccAWSCloudWatchLogGroup_multiple (18.58s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/aws    56.747s

Fixes #6169

The Update func was hitting a return err and when the err was empty, it
was skipping over the subsequent read func
@jen20
Copy link
Contributor

jen20 commented Apr 27, 2016

LGTM!

@stack72 stack72 merged commit c12a31e into master Apr 27, 2016
@stack72 stack72 deleted the b-cloudwatch-log-read branch April 27, 2016 23:02
} else {
log.Printf("[DEBUG] Deleting retention for CloudWatch Log Group: %q", name)
_, err = conn.DeleteRetentionPolicy(&cloudwatchlogs.DeleteRetentionPolicyInput{
LogGroupName: aws.String(name),
})
if err != nil {
return err
}
Copy link
Member

@radeksimko radeksimko Apr 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand what happened here (and thanks for the fix), but the duplication shouldn't be necessary - i.e. this if err block can be below once instead of twice in each if branch. 😉

xsellier pushed a commit to xsellier/terraform that referenced this pull request May 17, 2016
…ashicorp#6384)

Fixes hashicorp#6169

The Update func was hitting a return err and when the err was empty, it
was skipping over the subsequent read func
@ghost
Copy link

ghost commented Apr 26, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_cloudwatch_log_group w/ retention_in_days set results in no arn
3 participants