Skip to content

Instantly share code, notes, and snippets.

@jvanasco
Last active December 21, 2015 02:08
Show Gist options
  • Save jvanasco/6232500 to your computer and use it in GitHub Desktop.
Save jvanasco/6232500 to your computer and use it in GitHub Desktop.
diff against current graphite/carbon/whisper release (0.9.10) to ensure intermediate directories exist in the whisper database ( otherwise, stuff fails )
--- whisper.py 2013-08-14 11:59:04.000000000 -0400
+++ whisper.py.fix 2013-08-14 11:59:17.000000000 -0400
@@ -324,11 +324,6 @@
if os.path.exists(path):
raise InvalidConfiguration("File %s already exists!" % path)
+ # ensure the path
+ _path_dir = os.path.split(path)
+ if not os.path.exists( _path_dir ):
+ os.makedirs( _path_dir )
+
fh = open(path,'wb')
if LOCK:
fcntl.flock( fh.fileno(), fcntl.LOCK_EX )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment