Skip to content

Commit 68a1fcd

Browse files
authored
Merge pull request #167 from rcthomas/master
Support named servers
2 parents 58a02af + 9fb20f6 commit 68a1fcd

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

batchspawner/api.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ def post(self):
1212
else:
1313
# Previous jupyterhub, 0.9.4 and before.
1414
user = self.get_current_user()
15+
token = self.get_auth_token()
16+
spawner = None
17+
for s in user.spawners.values():
18+
if s.api_token == token:
19+
spawner = s
20+
break
1521
data = self.get_json_body()
1622
for key, value in data.items():
17-
if hasattr(user.spawner, key):
18-
setattr(user.spawner, key, value)
23+
if hasattr(spawner, key):
24+
setattr(spawner, key, value)
1925
self.finish(json.dumps({"message": "BatchSpawner data configured"}))
2026
self.set_status(201)
2127

batchspawner/singleuser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ def main(argv=None):
2222
run_path(cmd_path, run_name="__main__")
2323

2424
if __name__ == "__main__":
25-
main()
25+
main()

0 commit comments

Comments
 (0)