Skip to content

Commit

Permalink
changed if statement in ds role and modified the conflictswith
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickstruyf3 committed Nov 24, 2020
1 parent 45b35ff commit 53a3b48
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nutanix/data_source_nutanix_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ func dataSourceNutanixRole() *schema.Resource {
Read: dataSourceNutanixRoleRead,
Schema: map[string]*schema.Schema{
"role_id": {
Type: schema.TypeString,
Optional: true,
Type: schema.TypeString,
Optional: true,
ConflictsWith: []string{"role_name"},
},
"role_name": {
Type: schema.TypeString,
Expand Down Expand Up @@ -145,7 +146,7 @@ func dataSourceNutanixRoleRead(d *schema.ResourceData, meta interface{}) error {
accessID, iok := d.GetOk("role_id")
roleName, rnOk := d.GetOk("role_name")

if !iok || rnOk {
if !iok && !rnOk {
return fmt.Errorf("please provide `role_id` or `role_name`")
}

Expand Down

0 comments on commit 53a3b48

Please sign in to comment.