diff options
author | Zuul <zuul@review.openstack.org> | 2018-04-11 07:24:53 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-04-11 07:24:53 +0000 |
commit | c9ddee7aacf221ba78afda211385b7f590d94e9b (patch) | |
tree | 0d9fd552ab540cdd53cfd4b47e625e2f88ab3e67 /bin | |
parent | 3997b23e796dc6680e8a77ef50f2e05da2e043e3 (diff) | |
parent | 5b68eb5396edc33a64c6012a333c72d5a5878a64 (diff) | |
download | swift-c9ddee7aacf221ba78afda211385b7f590d94e9b.tar.gz |
Merge "swift-(account|container)-info: tolerate LockTimeouts"
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/swift-account-info | 3 | ||||
-rwxr-xr-x | bin/swift-container-info | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/bin/swift-account-info b/bin/swift-account-info index 554f5e009..e9ae188dc 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 136e48919..cbb10b6ec 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') |