示例#1
0
def main(argv=None):
    port = random_port()
    hub_auth = HubAuth()
    hub_auth.client_ca = os.environ.get('JUPYTERHUB_SSL_CLIENT_CA', '')
    hub_auth.certfile = os.environ.get('JUPYTERHUB_SSL_CERTFILE', '')
    hub_auth.keyfile = os.environ.get('JUPYTERHUB_SSL_KEYFILE', '')
    hub_auth._api_request(method='POST',
                          url=url_path_join(hub_auth.api_url, 'batchspawner'),
                          json={'port': port})

    cmd_path = which(sys.argv[1])
    sys.argv = sys.argv[1:] + ['--port={}'.format(port)]
    run_path(cmd_path, run_name="__main__")
def main(argv=None):
    port = random_port()
    hub_auth = HubAuth()
    hub_auth.client_ca = os.environ.get("JUPYTERHUB_SSL_CLIENT_CA", "")
    hub_auth.certfile = os.environ.get("JUPYTERHUB_SSL_CERTFILE", "")
    hub_auth.keyfile = os.environ.get("JUPYTERHUB_SSL_KEYFILE", "")
    hub_auth._api_request(
        method="POST",
        url=url_path_join(hub_auth.api_url, "batchspawner"),
        json={"port": port},
    )

    cmd_path = which(sys.argv[1])
    sys.argv = sys.argv[1:] + ["--port={}".format(port)]
    run_path(cmd_path, run_name="__main__")