Skip to content

Commit

Permalink
Address feedback of #9917 (#10338)
Browse files Browse the repository at this point in the history
  • Loading branch information
favoretti authored Jan 27, 2021
1 parent 5efb549 commit a752b4d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func resourceStorageDataLakeGen2FileSystemCreate(d *schema.ResourceData, meta in
}

aceRaw := d.Get("ace").([]interface{})
acl, err := parse.ExpandDataLakeGen2AceList(aceRaw)
acl, err := ExpandDataLakeGen2AceList(aceRaw)
if err != nil {
return fmt.Errorf("Error parsing ace list: %s", err)
}
Expand Down Expand Up @@ -201,7 +201,7 @@ func resourceStorageDataLakeGen2FileSystemUpdate(d *schema.ResourceData, meta in
}

aceRaw := d.Get("ace").([]interface{})
acl, err := parse.ExpandDataLakeGen2AceList(aceRaw)
acl, err := ExpandDataLakeGen2AceList(aceRaw)
if err != nil {
return fmt.Errorf("Error parsing ace list: %s", err)
}
Expand Down Expand Up @@ -309,7 +309,7 @@ func resourceStorageDataLakeGen2FileSystemRead(d *schema.ResourceData, meta inte
if err != nil {
return fmt.Errorf("Error parsing response ACL %q: %s", pathResponse.ACL, err)
}
d.Set("ace", parse.FlattenDataLakeGen2AceList(acl))
d.Set("ace", FlattenDataLakeGen2AceList(acl))

return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func resourceStorageDataLakeGen2PathCreate(d *schema.ResourceData, meta interfac
return fmt.Errorf("Unhandled resource type %q", resourceString)
}
aceRaw := d.Get("ace").([]interface{})
acl, err := parse.ExpandDataLakeGen2AceList(aceRaw)
acl, err := ExpandDataLakeGen2AceList(aceRaw)
if err != nil {
return fmt.Errorf("Error parsing ace list: %s", err)
}
Expand Down Expand Up @@ -248,7 +248,7 @@ func resourceStorageDataLakeGen2PathUpdate(d *schema.ResourceData, meta interfac
path := d.Get("path").(string)

aceRaw := d.Get("ace").([]interface{})
acl, err := parse.ExpandDataLakeGen2AceList(aceRaw)
acl, err := ExpandDataLakeGen2AceList(aceRaw)
if err != nil {
return fmt.Errorf("Error parsing ace list: %s", err)
}
Expand Down Expand Up @@ -336,7 +336,7 @@ func resourceStorageDataLakeGen2PathRead(d *schema.ResourceData, meta interface{
if err != nil {
return fmt.Errorf("Error parsing response ACL %q: %s", resp.ACL, err)
}
d.Set("ace", parse.FlattenDataLakeGen2AceList(acl))
d.Set("ace", FlattenDataLakeGen2AceList(acl))

return nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package parse
package storage

import (
"github.com/google/uuid"
Expand Down Expand Up @@ -58,9 +58,11 @@ func FlattenDataLakeGen2AceList(acl accesscontrol.ACL) []interface{} {
}
ace["scope"] = scope
ace["type"] = string(v.TagType)
id := ""
if v.TagQualifier != nil {
ace["id"] = v.TagQualifier.String()
id = v.TagQualifier.String()
}
ace["id"] = id
ace["permissions"] = v.Permissions

output[i] = ace
Expand Down

0 comments on commit a752b4d

Please sign in to comment.