From a9b738f00c856dc939699e0fe1263945cca61b6c Mon Sep 17 00:00:00 2001 From: Paul Stack Date: Thu, 28 Apr 2016 13:12:47 +0100 Subject: [PATCH] provider/aws: Removal of duplicate error handling code in cloudwatch_log_group cloudwatch_log_group --- .../providers/aws/resource_aws_cloudwatch_log_group.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/builtin/providers/aws/resource_aws_cloudwatch_log_group.go b/builtin/providers/aws/resource_aws_cloudwatch_log_group.go index 613651900..6135dee89 100644 --- a/builtin/providers/aws/resource_aws_cloudwatch_log_group.go +++ b/builtin/providers/aws/resource_aws_cloudwatch_log_group.go @@ -117,17 +117,15 @@ func resourceAwsCloudWatchLogGroupUpdate(d *schema.ResourceData, meta interface{ } log.Printf("[DEBUG] Setting retention for CloudWatch Log Group: %q: %s", name, input) _, err = conn.PutRetentionPolicy(&input) - if err != nil { - return err - } } 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 - } + } + + if err != nil { + return err } }