Skip to content

Commit

Permalink
Merge pull request #33 from stuartleeks/sl/32-fix-adls-path-delete
Browse files Browse the repository at this point in the history
Fix ADLS Path Deletion
  • Loading branch information
tombuildsstuff authored Aug 6, 2020
2 parents 6649426 + 662842d commit e1646b3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion storage/2018-11-09/datalakestore/paths/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusAccepted),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByClosing())
result = autorest.Response{Response: resp}

Expand Down
13 changes: 12 additions & 1 deletion storage/2018-11-09/datalakestore/paths/lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,19 @@ func TestLifecycle(t *testing.T) {
t.Fatal(fmt.Errorf("Expected new ACL %q, got %q", newACL, props.ACL))
}

t.Logf("[DEBUG] Deleting path 'test' ..")
if _, err = pathsClient.Delete(ctx, accountName, fileSystemName, path); err != nil {
t.Fatal(fmt.Errorf("Error deleting path: %s", err))
}

t.Logf("[DEBUG] Getting properties for folder 'test' (3) ..")
props, err = pathsClient.GetProperties(ctx, accountName, fileSystemName, path, GetPropertiesActionGetAccessControl)
if err == nil {
t.Fatal(fmt.Errorf("Didn't get error getting properties after deleting path (3)"))
}

t.Logf("[DEBUG] Deleting File System..")
if _, err := fileSystemsClient.Delete(ctx, accountName, fileSystemName); err != nil {
t.Fatalf("Error deleting: %s", err)
t.Fatalf("Error deleting filesystem: %s", err)
}
}
2 changes: 1 addition & 1 deletion storage/2018-11-09/datalakestore/paths/properties_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,5 @@ func (client Client) GetPropertiesResponder(resp *http.Response) (result GetProp
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}

return result, nil
return result, err
}

0 comments on commit e1646b3

Please sign in to comment.