diff --git a/swiftclient/shell.py b/swiftclient/shell.py index 2d2a7a1f..15ca5706 100755 --- a/swiftclient/shell.py +++ b/swiftclient/shell.py @@ -424,6 +424,7 @@ def st_list(parser, args, output_manager): datestamp, item_name) else: # list container contents subdir = item.get('subdir') + content_type = item.get('content_type') if subdir is None: item_bytes = item.get('bytes') byte_str = prt_bytes(item_bytes, options.human) @@ -436,7 +437,8 @@ def st_list(parser, args, output_manager): item_name = subdir if not options.totals: output_manager.print_msg( - "%s %10s %8s %s", byte_str, date, xtime, item_name) + "%s %10s %8s %24s %s", + byte_str, date, xtime, content_type, item_name) total_bytes += item_bytes # report totals diff --git a/tests/unit/test_shell.py b/tests/unit/test_shell.py index 835d1d44..cac4da20 100644 --- a/tests/unit/test_shell.py +++ b/tests/unit/test_shell.py @@ -293,6 +293,7 @@ class TestShell(testtools.TestCase): # Test container listing with --long connection.return_value.get_container.side_effect = [ [None, [{'name': 'object_a', 'bytes': 0, + 'content_type': 'type/content', 'last_modified': '123T456'}]], [None, []], ] @@ -306,7 +307,8 @@ class TestShell(testtools.TestCase): connection.return_value.get_container.assert_has_calls(calls) self.assertEqual(output.out, - ' 0 123 456 object_a\n' + ' 0 123 456' + ' type/content object_a\n' ' 0\n') @mock.patch('swiftclient.service.makedirs')