From 53a3b48abb1d31c9ec17f398ed6531a4764c9b99 Mon Sep 17 00:00:00 2001 From: Yannick Struyf Date: Tue, 24 Nov 2020 16:49:57 +0100 Subject: [PATCH] changed if statement in ds role and modified the conflictswith --- nutanix/data_source_nutanix_role.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nutanix/data_source_nutanix_role.go b/nutanix/data_source_nutanix_role.go index 790b0feef..3e53ca742 100644 --- a/nutanix/data_source_nutanix_role.go +++ b/nutanix/data_source_nutanix_role.go @@ -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, @@ -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`") }