From 67fff5b2973f5ca12316041664eddf3e8ece45be Mon Sep 17 00:00:00 2001 From: Madhuri Kumari Date: Fri, 11 Apr 2014 11:53:48 +0530 Subject: [PATCH] Print 'Container Count' in data base info Currently, 'Container Count' was missing in data base info. So this patch will help printing 'Container Count' also. Change-Id: I1ca80ee79e71b086b30fd2d1ab024ea1cfb324f5 --- swift/cli/info.py | 2 ++ test/unit/cli/test_info.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/swift/cli/info.py b/swift/cli/info.py index 179d5b16aa..9f893f6037 100644 --- a/swift/cli/info.py +++ b/swift/cli/info.py @@ -106,6 +106,8 @@ def print_db_info_metadata(db_type, info, metadata): print (' Delete Timestamp: %s (%s)' % (datetime.utcfromtimestamp(float(info['delete_timestamp'])), info['delete_timestamp'])) + if db_type == 'account': + print ' Container Count: %s' % info['container_count'] print ' Object Count: %s' % info['object_count'] print ' Bytes Used: %s' % info['bytes_used'] if db_type == 'container': diff --git a/test/unit/cli/test_info.py b/test/unit/cli/test_info.py index 88914493a9..306bb608b6 100644 --- a/test/unit/cli/test_info.py +++ b/test/unit/cli/test_info.py @@ -86,6 +86,7 @@ class TestCliInfo(unittest.TestCase): created_at=100.1, put_timestamp=106.3, delete_timestamp=107.9, + container_count='3', object_count='20', bytes_used='42') info['hash'] = 'abaddeadbeefcafe' @@ -102,6 +103,7 @@ Metadata: Created at: 1970-01-01 00:01:40.100000 (100.1) Put Timestamp: 1970-01-01 00:01:46.300000 (106.3) Delete Timestamp: 1970-01-01 00:01:47.900000 (107.9) + Container Count: 3 Object Count: 20 Bytes Used: 42 Chexor: abaddeadbeefcafe