Merge "swift-(account|container)-info: tolerate LockTimeouts"
This commit is contained in:
commit
c9ddee7aac
@ -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')
|
||||
|
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user