mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 15:33:02 +00:00
Merge pull request #842 from minrk/generate-path-error
finish error message when generate-config path does not exist
This commit is contained in:
@@ -180,7 +180,7 @@ class JupyterHub(Application):
|
|||||||
|
|
||||||
generate default config file:
|
generate default config file:
|
||||||
|
|
||||||
jupyterhub --generate-config -f /etc/jupyterhub/jupyterhub.py
|
jupyterhub --generate-config -f /etc/jupyterhub/jupyterhub_config.py
|
||||||
|
|
||||||
spawn the server on 10.0.1.2:443 with https:
|
spawn the server on 10.0.1.2:443 with https:
|
||||||
|
|
||||||
@@ -1346,6 +1346,11 @@ class JupyterHub(Application):
|
|||||||
|
|
||||||
def write_config_file(self):
|
def write_config_file(self):
|
||||||
"""Write our default config to a .py config file"""
|
"""Write our default config to a .py config file"""
|
||||||
|
config_file_dir = os.path.dirname(os.path.abspath(self.config_file))
|
||||||
|
if not os.path.isdir(config_file_dir):
|
||||||
|
self.exit("{} does not exist. The destination directory must exist before generating config file.".format(
|
||||||
|
config_file_dir,
|
||||||
|
))
|
||||||
if os.path.exists(self.config_file) and not self.answer_yes:
|
if os.path.exists(self.config_file) and not self.answer_yes:
|
||||||
answer = ''
|
answer = ''
|
||||||
def ask():
|
def ask():
|
||||||
|
Reference in New Issue
Block a user