From 55a1b63db501f18ba62e86a29db47465dce8eb26 Mon Sep 17 00:00:00 2001 From: Clay Gerrard Date: Wed, 10 Jan 2018 15:53:06 -0800 Subject: [PATCH] Let recon-cron work with conf.d Change-Id: I862b74e0d9b20ba149581c1add6473dc1e5b2859 --- bin/swift-recon-cron | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/bin/swift-recon-cron b/bin/swift-recon-cron index 8b3450b1a2..3c939a1b22 100755 --- a/bin/swift-recon-cron +++ b/bin/swift-recon-cron @@ -20,9 +20,8 @@ import os import sys from gettext import gettext as _ -from six.moves.configparser import ConfigParser -from swift.common.utils import get_logger, dump_recon_cache +from swift.common.utils import get_logger, dump_recon_cache, readconf from swift.obj.diskfile import ASYNCDIR_BASE @@ -46,17 +45,13 @@ def get_async_count(device_dir, logger): def main(): - c = ConfigParser() try: conf_path = sys.argv[1] except Exception: print("Usage: %s CONF_FILE" % sys.argv[0].split('/')[-1]) print("ex: swift-recon-cron /etc/swift/object-server.conf") sys.exit(1) - if not c.read(conf_path): - print("Unable to read config file %s" % conf_path) - sys.exit(1) - conf = dict(c.items('filter:recon')) + conf = readconf(conf_path, 'filter:recon') device_dir = conf.get('devices', '/srv/node') recon_cache_path = conf.get('recon_cache_path', '/var/cache/swift') recon_lock_path = conf.get('recon_lock_path', '/var/lock')