Skip to content

Commit e5c6957

Browse files
committed
check if external drives are excluded
1 parent 2195ec3 commit e5c6957

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

jupyter_drives/manager.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,14 @@ async def list_drives(self):
270270
if len(self._external_drives) != 0:
271271
for drive in self._external_drives.values():
272272
try:
273-
data.append({
274-
"name": drive['url'],
275-
"region": self._config.region_name if drive['url'] not in self._content_managers else self._content_managers[drive['url']]["location"],
276-
"creationDate": datetime.now().isoformat(timespec='milliseconds').replace('+00:00', 'Z'),
277-
"mounted": False if result.name not in self._content_managers else True,
278-
"provider": self._config.provider
279-
})
273+
if drive['url'] not in self._excluded_drives:
274+
data.append({
275+
"name": drive['url'],
276+
"region": self._config.region_name if drive['url'] not in self._content_managers else self._content_managers[drive['url']]["location"],
277+
"creationDate": datetime.now().isoformat(timespec='milliseconds').replace('+00:00', 'Z'),
278+
"mounted": False if result.name not in self._content_managers else True,
279+
"provider": self._config.provider
280+
})
280281
except Exception as e:
281282
raise tornado.web.HTTPError(
282283
status_code=httpx.codes.BAD_REQUEST,

0 commit comments

Comments
 (0)