Improve formatting for billions of objects

Change-Id: If8aa08c4c8c8ad6ca2c861602baf1eefa8642a8a
This commit is contained in:
Tim Burke 2021-09-20 12:33:16 -07:00
parent bcf19d47a3
commit 553e34ebfe
2 changed files with 11 additions and 9 deletions
swiftclient
test/unit

@ -552,7 +552,7 @@ def st_list(parser, args, output_manager, return_parser=False):
datestamp = '????-??-?? ??:??:??'
if not options['totals']:
output_manager.print_msg(
"%5s %s %s %s", count, byte_str,
"%12s %s %s %s", count, byte_str,
datestamp, item_name)
else: # list container contents
subdir = item.get('subdir')
@ -584,7 +584,7 @@ def st_list(parser, args, output_manager, return_parser=False):
if options['long'] or human:
if not container:
output_manager.print_msg(
"%5s %s", prt_bytes(total_count, True),
"%12s %s", prt_bytes(total_count, True),
prt_bytes(total_bytes, human))
else:
output_manager.print_msg(

@ -475,7 +475,8 @@ class TestShell(unittest.TestCase):
mock.call(marker='container', prefix=None, headers={})]
connection.return_value.get_account.assert_has_calls(calls)
self.assertEqual(output.out,
self.assertEqual(
output.out,
' 0 0 1970-01-01 00:00:01 container\n'
' 0 0\n')
@ -495,7 +496,8 @@ class TestShell(unittest.TestCase):
mock.call(marker='container', prefix=None, headers={})]
connection.return_value.get_account.assert_has_calls(calls)
self.assertEqual(output.out,
self.assertEqual(
output.out,
' 0 0 ????-??-?? ??:??:?? container\n'
' 0 0\n')