Use scheduler-specific log config and pidfile

This makes the scheduler configuration style match the rest of
the components.

Change-Id: I87fc2d1f7138ead83142f4634f6a74663fb1a82a
This commit is contained in:
James E. Blair 2017-06-23 20:53:09 +01:00
parent 01d733e95f
commit d1de946403
4 changed files with 7 additions and 8 deletions

View File

@ -125,7 +125,6 @@ webapp
scheduler
"""""""""
.. TODO: rename this to 'scheduler' (currently 'zuul') and update to match these docs
**tenant_config**
Path to tenant config file.

View File

@ -1870,7 +1870,7 @@ class ZuulTestCase(BaseTestCase):
os.path.join(
FIXTURE_DIR,
self.config.get('scheduler', 'tenant_config')))
self.config.set('zuul', 'state_dir', self.state_root)
self.config.set('scheduler', 'state_dir', self.state_root)
self.config.set('merger', 'git_dir', self.merger_src_root)
self.config.set('merger', 'state_dir', self.merger_state_root)
self.config.set('executor', 'git_dir', self.executor_src_root)

View File

@ -59,7 +59,7 @@ class Scheduler(zuul.cmd.ZuulApp):
signal.signal(signal.SIGHUP, signal.SIG_IGN)
self.log.debug("Reconfiguration triggered")
self.read_config()
self.setup_logging('zuul', 'log_config')
self.setup_logging('scheduler', 'log_config')
try:
self.sched.reconfigure(self.config)
except Exception:
@ -140,7 +140,7 @@ class Scheduler(zuul.cmd.ZuulApp):
self.config.getboolean('gearman_server', 'start')):
self.start_gear_server()
self.setup_logging('zuul', 'log_config')
self.setup_logging('scheduler', 'log_config')
self.log = logging.getLogger("zuul.Scheduler")
self.sched = zuul.scheduler.Scheduler(self.config)
@ -207,7 +207,7 @@ def main():
if scheduler.args.validate:
sys.exit(scheduler.test_config())
pid_fn = get_default(scheduler.config, 'zuul', 'pidfile',
pid_fn = get_default(scheduler.config, 'scheduler', 'pidfile',
'/var/run/zuul-scheduler/zuul-scheduler.pid',
expand_user=True)
pid = pid_file_module.TimeoutPIDLockFile(pid_fn, 10)

View File

@ -372,12 +372,12 @@ class Scheduler(threading.Thread):
self.log.debug("Waiting for exit")
def _get_queue_pickle_file(self):
state_dir = get_default(self.config, 'zuul', 'state_dir',
state_dir = get_default(self.config, 'scheduler', 'state_dir',
'/var/lib/zuul', expand_user=True)
return os.path.join(state_dir, 'queue.pickle')
def _get_time_database_dir(self):
state_dir = get_default(self.config, 'zuul', 'state_dir',
state_dir = get_default(self.config, 'scheduler', 'state_dir',
'/var/lib/zuul', expand_user=True)
d = os.path.join(state_dir, 'times')
if not os.path.exists(d):
@ -385,7 +385,7 @@ class Scheduler(threading.Thread):
return d
def _get_project_key_dir(self):
state_dir = get_default(self.config, 'zuul', 'state_dir',
state_dir = get_default(self.config, 'scheduler', 'state_dir',
'/var/lib/zuul', expand_user=True)
key_dir = os.path.join(state_dir, 'keys')
if not os.path.exists(key_dir):