diff options
author | Clay Gerrard <clay.gerrard@gmail.com> | 2018-01-10 15:53:06 -0800 |
---|---|---|
committer | Clay Gerrard <clay.gerrard@gmail.com> | 2018-01-11 12:36:45 -0800 |
commit | 55a1b63db501f18ba62e86a29db47465dce8eb26 (patch) | |
tree | c979f9b71a76361619a050d3ff760a7a2e89b4f3 /bin | |
parent | b0242f4fdc7d77b6c328ead519310d9ebb85f193 (diff) | |
download | swift-55a1b63db501f18ba62e86a29db47465dce8eb26.tar.gz |
Let recon-cron work with conf.d
Change-Id: I862b74e0d9b20ba149581c1add6473dc1e5b2859
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/swift-recon-cron | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/bin/swift-recon-cron b/bin/swift-recon-cron index 8b3450b1a..3c939a1b2 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') |