Skip to content

Commit

Permalink
Merge pull request #195 from yannickstruyf3/bugfix/fix_rolename_datas…
Browse files Browse the repository at this point in the history
…ource_error

changed if statement in ds role and modified the conflictswith
  • Loading branch information
marinsalinas authored Dec 1, 2020
2 parents 45b35ff + 53a3b48 commit 49b972c
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 49b972c

Please sign in to comment.