@@ -10,7 +10,6 @@ import (
1010 "strings"
1111
1212 "github.com/hashicorp/terraform/helper/hashcode"
13-
1413 "github.com/hashicorp/terraform/helper/schema"
1514 "github.com/hashicorp/terraform/helper/validation"
1615
@@ -504,8 +503,7 @@ func (s *AutoscalingAutoScalingConfigurationResourceCrud) mapToAction(fieldKeyFo
504503 result := oci_autoscaling.Action {}
505504
506505 if type_ , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "type" )); ok {
507- tmp := oci_autoscaling .ActionTypeEnum (type_ .(string ))
508- result .Type = tmp
506+ result .Type = oci_autoscaling .ActionTypeEnum (type_ .(string ))
509507 }
510508
511509 if value , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "value" )); ok {
@@ -587,21 +585,21 @@ func (s *AutoscalingAutoScalingConfigurationResourceCrud) mapToCreateAutoScaling
587585 tmp := make ([]oci_autoscaling.CreateConditionDetails , len (interfaces ))
588586 for i := range interfaces {
589587 stateDataIndex := autoScalingConfigurationPolicyRulesHashCodeForSets (interfaces [i ])
590- fieldKeyFormat := fmt .Sprintf ("%s.%d.%%s" , fmt .Sprintf (fieldKeyFormat , "rules" ), stateDataIndex )
591- converted , err := s .mapToCreateConditionDetails (fieldKeyFormat )
588+ fieldKeyFormatNextLevel := fmt .Sprintf ("%s.%d.%%s" , fmt .Sprintf (fieldKeyFormat , "rules" ), stateDataIndex )
589+ converted , err := s .mapToCreateConditionDetails (fieldKeyFormatNextLevel )
592590 if err != nil {
593- return nil , err
591+ return details , err
594592 }
595593 tmp [i ] = converted
596594 }
597595 details .Rules = tmp
598596 }
599597 if capacity , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "capacity" )); ok {
600598 if tmpList := capacity .([]interface {}); len (tmpList ) > 0 {
601- fieldKeyFormat := fmt .Sprintf ("%s.%d.%%s" , fmt .Sprintf (fieldKeyFormat , "capacity" ), 0 )
602- tmp , err := s .mapToCapacity (fieldKeyFormat )
599+ fieldKeyFormatNextLevel := fmt .Sprintf ("%s.%d.%%s" , fmt .Sprintf (fieldKeyFormat , "capacity" ), 0 )
600+ tmp , err := s .mapToCapacity (fieldKeyFormatNextLevel )
603601 if err != nil {
604- return nil , err
602+ return details , fmt . Errorf ( "unable to convert capacity, encountered error: %v" , err )
605603 }
606604 details .Capacity = & tmp
607605 }
@@ -717,8 +715,7 @@ func (s *AutoscalingAutoScalingConfigurationResourceCrud) mapToMetric(fieldKeyFo
717715 result := oci_autoscaling.Metric {}
718716
719717 if metricType , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "metric_type" )); ok {
720- tmp := oci_autoscaling .MetricMetricTypeEnum (metricType .(string ))
721- result .MetricType = tmp
718+ result .MetricType = oci_autoscaling .MetricMetricTypeEnum (metricType .(string ))
722719 }
723720
724721 if threshold , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "threshold" )); ok {
@@ -790,8 +787,7 @@ func (s *AutoscalingAutoScalingConfigurationResourceCrud) mapToThreshold(fieldKe
790787 result := oci_autoscaling.Threshold {}
791788
792789 if operator , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "operator" )); ok {
793- tmp := oci_autoscaling .ThresholdOperatorEnum (operator .(string ))
794- result .Operator = tmp
790+ result .Operator = oci_autoscaling .ThresholdOperatorEnum (operator .(string ))
795791 }
796792
797793 if value , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "value" )); ok {
0 commit comments