mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-12 12:33:02 +00:00
Remove handling of jupyterhub 0.8
These only affected servers upgrading directly from 0.8 or earlier with still-running servers 0.8 was a long time ago, it's okay to require restarting servers for an upgrade that long
This commit is contained in:
@@ -2274,10 +2274,6 @@ class JupyterHub(Application):
|
|||||||
for user in self.users.values():
|
for user in self.users.values():
|
||||||
for spawner in user.spawners.values():
|
for spawner in user.spawners.values():
|
||||||
oauth_client_ids.add(spawner.oauth_client_id)
|
oauth_client_ids.add(spawner.oauth_client_id)
|
||||||
# avoid deleting clients created by 0.8
|
|
||||||
# 0.9 uses `jupyterhub-user-...` for the client id, while
|
|
||||||
# 0.8 uses just `user-...`
|
|
||||||
oauth_client_ids.add(spawner.oauth_client_id.split('-', 1)[1])
|
|
||||||
|
|
||||||
for i, oauth_client in enumerate(self.db.query(orm.OAuthClient)):
|
for i, oauth_client in enumerate(self.db.query(orm.OAuthClient)):
|
||||||
if oauth_client.identifier not in oauth_client_ids:
|
if oauth_client.identifier not in oauth_client_ids:
|
||||||
|
@@ -804,14 +804,8 @@ class User:
|
|||||||
if orm_token:
|
if orm_token:
|
||||||
self.db.delete(orm_token)
|
self.db.delete(orm_token)
|
||||||
# remove oauth client as well
|
# remove oauth client as well
|
||||||
# handle upgrades from 0.8, where client id will be `user-USERNAME`,
|
for oauth_client in self.db.query(orm.OAuthClient).filter_by(
|
||||||
# not just `jupyterhub-user-USERNAME`
|
identifier=spawner.oauth_client_id,
|
||||||
client_ids = (
|
|
||||||
spawner.oauth_client_id,
|
|
||||||
spawner.oauth_client_id.split('-', 1)[1],
|
|
||||||
)
|
|
||||||
for oauth_client in self.db.query(orm.OAuthClient).filter(
|
|
||||||
orm.OAuthClient.identifier.in_(client_ids)
|
|
||||||
):
|
):
|
||||||
self.log.debug("Deleting oauth client %s", oauth_client.identifier)
|
self.log.debug("Deleting oauth client %s", oauth_client.identifier)
|
||||||
self.db.delete(oauth_client)
|
self.db.delete(oauth_client)
|
||||||
|
Reference in New Issue
Block a user