Skip to content

Commit

Permalink
Properly initialize settings dir
Browse files Browse the repository at this point in the history
Since config.yaml gets now saved on server startup before settings basedir gets initialized by other means (e.g. first access of base folder for uploads), it was not created yet when the config.yaml was tried to be saved upon first start up, causing an error at server startup.

Closes OctoPrint#604
  • Loading branch information
foosel committed Oct 16, 2014
1 parent 62a51bb commit a332b71
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/octoprint/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ def _init_settings_dir(self, basedir):
else:
self.settings_dir = _resolveSettingsDir(APPNAME)

if not os.path.isdir(self.settings_dir):
os.makedirs(self.settings_dir)

def _getDefaultFolder(self, type):
folder = default_settings["folder"][type]
if folder is None:
Expand Down

0 comments on commit a332b71

Please sign in to comment.