From f9d14971c2da8d5b142cce9771496f5a7682b4a7 Mon Sep 17 00:00:00 2001 From: Florian Hines Date: Sat, 4 Jan 2014 00:19:22 -0600 Subject: [PATCH] Don't report async pendings on exception If we encounter an exception trying to gather async pendings 'async' doesn't exist and the cronjob ends up erroring out and leaving behind a stale lock file. Change-Id: I70a6d3f00bd2c9ce742e6d16af93804280707040 --- bin/swift-recon-cron | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/swift-recon-cron b/bin/swift-recon-cron index 81edc636cb..44a9017ca0 100755 --- a/bin/swift-recon-cron +++ b/bin/swift-recon-cron @@ -63,12 +63,10 @@ def main(): sys.exit(1) try: asyncs = get_async_count(device_dir, logger) + dump_recon_cache({'async_pending': asyncs}, cache_file, logger) except Exception: logger.exception( _('Exception during recon-cron while accessing devices')) - - dump_recon_cache({'async_pending': asyncs}, cache_file, logger) - try: os.rmdir(lock_dir) except Exception: