diff --git a/bin/swift-account-info b/bin/swift-account-info index 554f5e0095..e9ae188dca 100755 --- a/bin/swift-account-info +++ b/bin/swift-account-info @@ -16,6 +16,7 @@ import sys from optparse import OptionParser from swift.cli.info import print_info, InfoSystemExit +from swift.common.exceptions import LockTimeout def run_print_info(args, opts): @@ -23,7 +24,7 @@ def run_print_info(args, opts): print_info('account', *args, **opts) except InfoSystemExit: sys.exit(1) - except sqlite3.OperationalError as e: + except (sqlite3.OperationalError, LockTimeout) as e: if not opts.get('stale_reads_ok'): opts['stale_reads_ok'] = True print('Warning: Possibly Stale Data') diff --git a/bin/swift-container-info b/bin/swift-container-info index 136e489192..cbb10b6ec0 100755 --- a/bin/swift-container-info +++ b/bin/swift-container-info @@ -16,6 +16,7 @@ import sys from optparse import OptionParser from swift.cli.info import print_info, InfoSystemExit +from swift.common.exceptions import LockTimeout def run_print_info(args, opts): @@ -23,7 +24,7 @@ def run_print_info(args, opts): print_info('container', *args, **opts) except InfoSystemExit: sys.exit(1) - except sqlite3.OperationalError as e: + except (sqlite3.OperationalError, LockTimeout) as e: if not opts.get('stale_reads_ok'): opts['stale_reads_ok'] = True print('Warning: Possibly Stale Data')