Only apply custom umask if NB_UMASK is set

This commit is contained in:
Peter Parente
2018-12-28 13:28:03 -05:00
parent 1ec114a8ca
commit fbba48c435
2 changed files with 4 additions and 3 deletions

View File

@@ -38,5 +38,7 @@ if 'GEN_CERT' in os.environ:
os.chmod(pem_file, stat.S_IRUSR | stat.S_IWUSR)
c.NotebookApp.certfile = pem_file
# Change default umask if set using flag
os.umask(int(os.environ['NB_UMASK'], 8))
# Change default umask for all subprocesses of the notebook server if set in
# the environment
if 'NB_UMASK' in os.environ:
os.umask(int(os.environ['NB_UMASK'], 8))