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
1
2
import os
2
3
import sys
3
4
7
8
from jupyterhub .utils import random_port , url_path_join
8
9
from jupyterhub .services .auth import HubAuth
9
10
11
+ from tornado .escape import json_encode
10
12
11
13
def main (argv = None ):
12
14
port = random_port ()
13
15
hub_auth = HubAuth ()
14
16
hub_auth .client_ca = os .environ .get ("JUPYTERHUB_SSL_CLIENT_CA" , "" )
15
17
hub_auth .certfile = os .environ .get ("JUPYTERHUB_SSL_CERTFILE" , "" )
16
18
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
+ )
21
25
)
22
26
23
27
cmd_path = which (sys .argv [1 ])
You can’t perform that action at this time.
0 commit comments