mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 14:03:02 +00:00
catch errors in cleanup
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
# Copyright (c) Jupyter Development Team.
|
# Copyright (c) Jupyter Development Team.
|
||||||
# Distributed under the terms of the Modified BSD License.
|
# Distributed under the terms of the Modified BSD License.
|
||||||
|
|
||||||
import asyncio
|
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
from getpass import getuser
|
from getpass import getuser
|
||||||
@@ -12,6 +11,7 @@ from subprocess import TimeoutExpired
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
from pytest import fixture, raises
|
from pytest import fixture, raises
|
||||||
from tornado import ioloop, gen
|
from tornado import ioloop, gen
|
||||||
|
from tornado.httpclient import HTTPError
|
||||||
|
|
||||||
from .. import orm
|
from .. import orm
|
||||||
from .. import crypto
|
from .. import crypto
|
||||||
@@ -71,8 +71,10 @@ def cleanup_after(request, io_loop):
|
|||||||
for uid, user in app.users.items():
|
for uid, user in app.users.items():
|
||||||
for name, spawner in list(user.spawners.items()):
|
for name, spawner in list(user.spawners.items()):
|
||||||
if spawner.active:
|
if spawner.active:
|
||||||
print('closing', user)
|
try:
|
||||||
io_loop.run_sync(lambda: app.proxy.delete_user(user, name))
|
io_loop.run_sync(lambda: app.proxy.delete_user(user, name))
|
||||||
|
except HTTPError:
|
||||||
|
pass
|
||||||
io_loop.run_sync(lambda: user.stop(name))
|
io_loop.run_sync(lambda: user.stop(name))
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user