@@ -311,7 +311,11 @@ async def mount_drive(self, drive_name, provider):
311311 """
312312 try :
313313 if provider == 's3' :
314- region = await self ._get_drive_location (drive_name )
314+ if drive_name in self ._external_drives and self ._external_drives [drive_name ]["is_public" ] is False :
315+ print ('FOUND DRIVE IN EXTERNAL TO MOUNT: ' , self ._external_drives [drive_name ]["location" ])
316+ region = self ._external_drives [drive_name ]["location" ]
317+ else :
318+ region = await self ._get_drive_location (drive_name )
315319 self ._initialize_content_manager (drive_name , provider , region )
316320 except Exception as e :
317321 raise tornado .web .HTTPError (
@@ -712,18 +716,21 @@ async def new_drive(self, new_drive_name, location='us-east-1'):
712716
713717 return
714718
715- async def add_public_drive (self , drive_name ):
719+ async def add_external_drive (self , drive_name , is_public , region = 'us-east-1' ):
716720 """Mount a drive.
717721
718722 Args:
719723 drive_name: name of public bucket to mount
720724 """
721725 try :
722726 drive = {
723- "is_public" : True ,
724- "url" : drive_name
727+ "is_public" : is_public ,
728+ "url" : drive_name ,
729+ "location" : region
725730 };
731+ print ('ADDED DRIVE: ' , drive )
726732 self ._external_drives [drive_name ] = drive ;
733+ print ('NEW EXTERNAL DRIVEs: ' , self ._external_drives )
727734 except Exception as e :
728735 raise tornado .web .HTTPError (
729736 status_code = httpx .codes .BAD_REQUEST ,
0 commit comments