Skip to content

Commit

Permalink
Merge branch 'cluster-folder-methods' into use-cluster-folder-apis
Browse files Browse the repository at this point in the history
  • Loading branch information
jlewitt1 committed Aug 12, 2024
2 parents ebb8cd7 + 88e36d7 commit 8f8df32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
14 changes: 2 additions & 12 deletions runhouse/servers/http/http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,9 @@ async def wrapper(*args, **kwargs):

func_call: bool = func.__name__ in ["post_call", "get_call"]

# restrict access for folder APIs
# restrict access for folder specific APIs
access_level_required = (
ResourceAccess.WRITE
if func.__name__
in [
"folder_ls_cmd",
"folder_mkdir_cmd",
"folder_get_cmd",
"folder_put_cmd",
"folder_rm_cmd",
"folder_mv_cmd",
]
else None
ResourceAccess.WRITE if func.__name__.startswith("folder") else None
)
token = get_token_from_request(request)

Expand Down
4 changes: 1 addition & 3 deletions tests/test_resources/test_clusters/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,13 +939,11 @@ def test_cluster_mkdir_mv_and_rm(self, cluster):
assert "new-folder" in [os.path.basename(f) for f in file_contents]

# Should not be able to mv to an existing directory if `overwrite=False`
with pytest.raises(FileExistsError):
with pytest.raises(Exception):
cluster._folder_mv(
path="~/.rh/new-folder", dest_path="~/new-folder", overwrite=False
)

cluster._folder_mv(path="~/.rh/new-folder", dest_path="~/new-folder")

# Delete folder contents and directory itself
cluster._folder_rm(path="~/new-folder", recursive=True)

Expand Down

0 comments on commit 8f8df32

Please sign in to comment.