Merge pull request #842 from minrk/generate-path-error

finish error message when generate-config path does not exist
This commit is contained in:
Carol Willing
2016-11-01 09:26:52 -07:00
committed by GitHub

View File

@@ -180,7 +180,7 @@ class JupyterHub(Application):
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:
@@ -1346,6 +1346,11 @@ class JupyterHub(Application):
def write_config_file(self):
"""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:
answer = ''
def ask():