Skip to content

Commit 87c06ce

Browse files
committed
Don't pass us-east-1 as value during bucket creation
1 parent 53f60b9 commit 87c06ce

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jupyter_drives/manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,15 +695,17 @@ async def check_file(self, drive_name, path):
695695

696696
return
697697

698-
async def new_drive(self, new_drive_name, location='us-east-1'):
698+
async def new_drive(self, new_drive_name, location):
699699
"""Create a new drive in the given location.
700700
701701
Args:
702702
new_drive_name: name of new drive to create
703703
location: (optional) region of bucket
704704
"""
705705
try:
706-
await self._file_system._mkdir(new_drive_name, region_name = location)
706+
# AWS returns an error if the region is set to 'us-east-1' (Their default)
707+
region_name = '' if location == 'us-east-1' else location
708+
await self._file_system._mkdir(new_drive_name, region_name)
707709
except Exception as e:
708710
raise tornado.web.HTTPError(
709711
status_code= httpx.codes.BAD_REQUEST,

0 commit comments

Comments
 (0)