File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 1+ import asyncio
12import os
23import sys
34
78from jupyterhub .utils import random_port , url_path_join
89from jupyterhub .services .auth import HubAuth
910
11+ from tornado .escape import json_encode
1012
1113def main (argv = None ):
1214 port = random_port ()
1315 hub_auth = HubAuth ()
1416 hub_auth .client_ca = os .environ .get ("JUPYTERHUB_SSL_CLIENT_CA" , "" )
1517 hub_auth .certfile = os .environ .get ("JUPYTERHUB_SSL_CERTFILE" , "" )
1618 hub_auth .keyfile = os .environ .get ("JUPYTERHUB_SSL_KEYFILE" , "" )
17- hub_auth ._api_request (
18- method = "POST" ,
19- url = url_path_join (hub_auth .api_url , "batchspawner" ),
20- json = {"port" : port },
19+ asyncio .run (
20+ hub_auth ._api_request (
21+ method = "POST" ,
22+ url = url_path_join (hub_auth .api_url , "batchspawner" ),
23+ body = json_encode ({"port" : port })
24+ )
2125 )
2226
2327 cmd_path = which (sys .argv [1 ])
You can’t perform that action at this time.
0 commit comments