Skip to content

Commit

Permalink
nameAttr from ou attribute instead of non checked name attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-ruth committed Mar 30, 2023
1 parent 5a80084 commit 6d46e17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ldap/resource_ldap_ou.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func resourceLDAPOURead(ctx context.Context, d *schema.ResourceData, m interface
}

// Remove the `OU=<ou-name>,` from the DN to get the OU
ou := strings.ReplaceAll(dn, fmt.Sprintf("OU=%s,", attributes["name"][0]), "")
ou := strings.Replace(dn, fmt.Sprintf("OU=%s,", nameAttr[0]), "", 1)
if err := d.Set("ou", ou); err != nil {
return diag.FromErr(err)
}
Expand Down

0 comments on commit 6d46e17

Please sign in to comment.