summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Blaisot <sebastien@blaisot.org>2019-11-15 22:37:38 +0100
committerSébastien Blaisot <sebastien@blaisot.org>2019-11-15 22:37:38 +0100
commit709ab385c6eb3d3c7b313bc48c959e9ace606ae5 (patch)
tree62a31170f4f5cf5a573efe209fa8a88a915d3c16
parentc4bef14fc1975f2e115a6ec8560e674e8aa5b1bf (diff)
downloadpython-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
-rwxr-xr-xswiftclient/shell.py6
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)