Skip to content

Commit

Permalink
Fixing a few bugs left over from removing the hardcoded paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroome committed May 10, 2011
1 parent 3a84c44 commit 6648a81
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions bin/ogslbd
Expand Up @@ -92,8 +92,8 @@ def main(argv):
signal.signal(signal.SIGINT, signal_handler)

# define some defaults
configFile = '/opt/ogslb/etc/config.xml'
pollerFile = '/opt/ogslb/etc/poller.xml'
configFile = scriptPath + '/../etc/config.xml'
pollerFile = scriptPath + '/../etc/poller.xml'
debug = 0
overrideLogFile = ''

Expand All @@ -117,7 +117,7 @@ def main(argv):
configFile = arg

# load up the configs
Config = ParseXML.parseConfig(configFile);
Config = ParseConfig.parseConfig(configFile);

# set the logfile to use
try:
Expand Down Expand Up @@ -150,7 +150,7 @@ def main(argv):
logger.info('startup')

# parse the poller config
vips = ParseXML.parseConfig(pollerFile);
vips = ParseXML.parseXML(pollerFile);

# for each of the hostnames we are monitoring, we stick the name in redis
# that way, we can associate which timeseries keys we are monitoring
Expand Down
1 change: 0 additions & 1 deletion lib/ParseConfig.py
Expand Up @@ -43,6 +43,5 @@ def parseConfig(filename='config.xml'):
except:
logger.debug("error getting config")


return(config)

2 changes: 1 addition & 1 deletion lib/ParseXML.py
Expand Up @@ -33,7 +33,7 @@ def getText(nodelist):
return ''.join(rc)

# parse the xml for pollers
def parseConfig(filename='poller.xml'):
def parseXML(filename='poller.xml'):
dom = xml.dom.minidom.parse(filename);
vips = {}

Expand Down
9 changes: 5 additions & 4 deletions lib/Poller.py
Expand Up @@ -42,7 +42,7 @@ def __init__(self, queue, Config, responderQueue, threadID):
# figure out where the protocol analizers live
protoDir = ''
try:
protoDir = Config['protodir']
protoDir = self.Config['protodir']
except:
protoDir = '/opt/ogslb/proto' # default to here if not configured in config.xml
protoDir += '/*.py'
Expand All @@ -52,11 +52,12 @@ def __init__(self, queue, Config, responderQueue, threadID):
fl = glob.glob(protoDir)
self.adapters = {}
for i in range(len(fl)):
file = fl[i]
fl[i] = fl[i].split('/')[4]
filename = fl[i]
modpath = fl[i].split('/')
fl[i] = modpath[len(modpath) - 1]
if fl[i] != '__init__.py': # don't try to load the __init__.py file
fl[i] = fl[i][0:(len(fl[i])-3)]
r = imp.load_source(fl[i], file)
r = imp.load_source(fl[i], filename)
self.adapters[fl[i]] = r

def __del__(self):
Expand Down

0 comments on commit 6648a81

Please sign in to comment.