graphite-dev team mailing list archive
-
graphite-dev team
-
Mailing list archive
-
Message #01242
settings.py
Hi All, not sure of the best way to submit a minor change like this but I was having some issues with Graphite not being able to find and open my database that I was able to fix with a minor code change.
Our installation uses a number of custom directories that are not the default for the graphite installation. I was using the local_settings.py file to set all of the custom directories etc. but the locations of the WHISPER_DIR and RRD_DIR. Were not updating correctly. I looked at the settings.py file and can see that these are initialized depending on whether rrdtool imports successfully or not.
Moving the following code to run after importing the local_settings fixed it for me.
try:
import rrdtool
DATA_DIRS = [WHISPER_DIR, RRD_DIR]
except:
DATA_DIRS = [WHISPER_DIR]
It looks like nothing of but variable initialization occurs prior to this code so changing it to import rrdtool after getting my custom settings fixes the issue.
#Pull in overrides from local_settings.py
try:
from graphite.local_settings import *
except ImportError:
print >> sys.stderr, "Could not import graphite.local_settings, using defaults!"
try:
import rrdtool
DATA_DIRS = [WHISPER_DIR, RRD_DIR]
except:
DATA_DIRS = [WHISPER_DIR]
Thanks for an awesome tool! Hopefully, I am not spamming you.
Cody Stevens
RightNow Technologies
Follow ups