Skip to content

Commit

Permalink
Merge pull request #10795 from paulomarquesc/pmarques/fix_10773
Browse files Browse the repository at this point in the history
Fixes bug #10773
  • Loading branch information
tombuildsstuff authored Mar 4, 2021
2 parents 4113a55 + 05559b7 commit 1bd87df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
7 changes: 2 additions & 5 deletions azurerm/internal/services/netapp/netapp_volume_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,8 @@ func dataSourceNetAppVolumeRead(d *schema.ResourceData, meta interface{}) error
if err := d.Set("mount_ip_addresses", flattenNetAppVolumeMountIPAddresses(props.MountTargets)); err != nil {
return fmt.Errorf("setting `mount_ip_addresses`: %+v", err)
}

if props.DataProtection.Replication != nil {
if err := d.Set("data_protection_replication", flattenNetAppVolumeDataProtectionReplication(props.DataProtection)); err != nil {
return fmt.Errorf("setting `data_protection_replication`: %+v", err)
}
if err := d.Set("data_protection_replication", flattenNetAppVolumeDataProtectionReplication(props.DataProtection)); err != nil {
return fmt.Errorf("setting `data_protection_replication`: %+v", err)
}
}

Expand Down
12 changes: 7 additions & 5 deletions azurerm/internal/services/netapp/netapp_volume_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,8 @@ func resourceNetAppVolumeRead(d *schema.ResourceData, meta interface{}) error {
if err := d.Set("mount_ip_addresses", flattenNetAppVolumeMountIPAddresses(props.MountTargets)); err != nil {
return fmt.Errorf("setting `mount_ip_addresses`: %+v", err)
}
if props.DataProtection.Replication != nil {
if err := d.Set("data_protection_replication", flattenNetAppVolumeDataProtectionReplication(props.DataProtection)); err != nil {
return fmt.Errorf("setting `data_protection_replication`: %+v", err)
}
if err := d.Set("data_protection_replication", flattenNetAppVolumeDataProtectionReplication(props.DataProtection)); err != nil {
return fmt.Errorf("setting `data_protection_replication`: %+v", err)
}
}

Expand Down Expand Up @@ -789,7 +787,11 @@ func flattenNetAppVolumeMountIPAddresses(input *[]netapp.MountTargetProperties)
}

func flattenNetAppVolumeDataProtectionReplication(input *netapp.VolumePropertiesDataProtection) []interface{} {
if input == nil || input.Replication == nil || strings.ToLower(string(input.Replication.EndpointType)) != "dst" {
if input == nil || input.Replication == nil {
return []interface{}{}
}

if strings.ToLower(string(input.Replication.EndpointType)) == "" || strings.ToLower(string(input.Replication.EndpointType)) != "dst" {
return []interface{}{}
}

Expand Down

0 comments on commit 1bd87df

Please sign in to comment.