diff options
author | Sébastien Blaisot <sebastien@blaisot.org> | 2019-11-15 22:37:38 +0100 |
---|---|---|
committer | Sébastien Blaisot <sebastien@blaisot.org> | 2019-11-15 22:37:38 +0100 |
commit | 709ab385c6eb3d3c7b313bc48c959e9ace606ae5 (patch) | |
tree | 62a31170f4f5cf5a573efe209fa8a88a915d3c16 /swiftclient | |
parent | c4bef14fc1975f2e115a6ec8560e674e8aa5b1bf (diff) | |
download | python-swiftclient-709ab385c6eb3d3c7b313bc48c959e9ace606ae5.tar.gz |
Fix printed object names on successful bulk-delete
Replace the 1 always concatenated to printed object names for each
successfully deleted object in bulk-delete with an optional [after x
attempts] if x > 1
Change-Id: If4af9141fe4f3436a4e9e0e2dfc24c6ec7292996
Closes-Bug: 1852808
Diffstat (limited to 'swiftclient')
-rwxr-xr-x | swiftclient/shell.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py index cc4f325..5e23bc4 100755 --- a/swiftclient/shell.py +++ b/swiftclient/shell.py @@ -169,7 +169,8 @@ def st_delete(parser, args, output_manager, return_parser=False): for r in del_iter: c = r.get('container', '') o = r.get('object', '') - a = r.get('attempts') + a = (' [after {0} attempts]'.format(r.get('attempts')) + if r.get('attempts') > 1 else '') if r['action'] == 'bulk_delete': if r['success']: @@ -202,9 +203,6 @@ def st_delete(parser, args, output_manager, return_parser=False): else: if r['success']: if options['verbose']: - a = (' [after {0} attempts]'.format(a) - if a > 1 else '') - if r['action'] == 'delete_object': if options['yes_all']: p = '{0}/{1}'.format(c, o) |