summaryrefslogtreecommitdiff
path: root/zuul/scheduler.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-26 21:20:49 +0000
committerGerrit Code Review <review@openstack.org>2017-06-26 21:20:49 +0000
commit559e56256a4cae2b4e928f520912cccdf03a3063 (patch)
treed24820f437e385238066cc9be88f35880889ecb5 /zuul/scheduler.py
parentb5910f1f903a2d041d643a0261031465c86d57ae (diff)
parent91601d788e414be3766d574c0dc67d4592de80fb (diff)
downloadzuul-559e56256a4cae2b4e928f520912cccdf03a3063.tar.gz
Merge "config: refactor config get default" into feature/zuulv3
Diffstat (limited to 'zuul/scheduler.py')
-rw-r--r--zuul/scheduler.py22
1 files changed, 7 insertions, 15 deletions
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index 207616313..c76230997 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -30,6 +30,7 @@ from zuul import configloader
from zuul import model
from zuul import exceptions
from zuul import version as zuul_version
+from zuul.lib.config import get_default
class ManagementEvent(object):
@@ -371,30 +372,21 @@ class Scheduler(threading.Thread):
self.log.debug("Waiting for exit")
def _get_queue_pickle_file(self):
- if self.config.has_option('zuul', 'state_dir'):
- state_dir = os.path.expanduser(self.config.get('zuul',
- 'state_dir'))
- else:
- state_dir = '/var/lib/zuul'
+ state_dir = get_default(self.config, 'zuul', 'state_dir',
+ '/var/lib/zuul', expand_user=True)
return os.path.join(state_dir, 'queue.pickle')
def _get_time_database_dir(self):
- if self.config.has_option('zuul', 'state_dir'):
- state_dir = os.path.expanduser(self.config.get('zuul',
- 'state_dir'))
- else:
- state_dir = '/var/lib/zuul'
+ state_dir = get_default(self.config, 'zuul', 'state_dir',
+ '/var/lib/zuul', expand_user=True)
d = os.path.join(state_dir, 'times')
if not os.path.exists(d):
os.mkdir(d)
return d
def _get_project_key_dir(self):
- if self.config.has_option('zuul', 'state_dir'):
- state_dir = os.path.expanduser(self.config.get('zuul',
- 'state_dir'))
- else:
- state_dir = '/var/lib/zuul'
+ state_dir = get_default(self.config, 'zuul', 'state_dir',
+ '/var/lib/zuul', expand_user=True)
key_dir = os.path.join(state_dir, 'keys')
if not os.path.exists(key_dir):
os.mkdir(key_dir, 0o700)