This commit is contained in:
Nick Hurley 2013-01-29 14:08:53 -08:00
Родитель 7b2d72225b
Коммит 4be4c7b98a
2 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -13,9 +13,9 @@ import stoneridge
class StoneRidgeMaster(stoneridge.QueueListener): class StoneRidgeMaster(stoneridge.QueueListener):
def setup(self, config): def setup(self, config):
self.queues = { self.queues = {
'broadband': stoneridge.QueueWriter(stoneridge.BROADBAND_QUEUE), 'broadband': stoneridge.QueueWriter(stoneridge.NETCONFIG_QUEUES['broadband']),
'umts': stoneridge.QueueWriter(stoneridge.UMTS_QUEUE), 'umts': stoneridge.QueueWriter(stoneridge.NETCONFIG_QUEUES['umts']),
'gsm': stoneridge.QueueWriter(stoneridge.GSM_QUEUE) 'gsm': stoneridge.QueueWriter(stoneridge.NETCONFIG_QUEUES['gsm'])
} }
self.logdir = stoneridge.get_config('stoneridge', 'logs') self.logdir = stoneridge.get_config('stoneridge', 'logs')
self.config = config self.config = config

Просмотреть файл

@ -106,7 +106,7 @@ def get_config(section, option, default=None):
val = _cp.get(section, option) val = _cp.get(section, option)
logging.debug('found %s.%s, returning %s' % (section, option, val)) logging.debug('found %s.%s, returning %s' % (section, option, val))
return val return val
except ConfigParser.NoSectionError, ConfigParser.NoOptionError as e: except (ConfigParser.NoSectionError, ConfigParser.NoOptionError) as e:
logging.debug('unable to find %s.%s, returning default %s' % logging.debug('unable to find %s.%s, returning default %s' %
(section, option, default)) (section, option, default))
return default return default
@ -243,9 +243,10 @@ def get_buildid_suffix():
return _buildid_suffix return _buildid_suffix
def run_process(*args, logger=logging): def run_process(*args, **kwargs):
"""Run a python process under the stoneridge environment. """Run a python process under the stoneridge environment.
""" """
logger = kwargs.get('logger', logging)
procname = args[0] procname = args[0]
command = [sys.executable] + args command = [sys.executable] + args
logger.debug('Running %s' % (procname,)) logger.debug('Running %s' % (procname,))