Add content-type in list of container content
Change-Id: Ie0787d5ffbee0a7d2429cb285fa6ecdf722e4ae1
This commit is contained in:
parent
ad5656020c
commit
3e1a457db0
@ -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
|
||||
|
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user