From 5d1d48c7738a9bb468fdaea4cf271901641a6d51 Mon Sep 17 00:00:00 2001 From: Alistair Coles Date: Thu, 13 May 2021 12:05:20 +0100 Subject: [PATCH] swift-manage-shard-ranges: output total compactible sequences After individual compactible sequences have been listed, add a summary line such as: Total of 123 shard sequences identified for compaction. Change-Id: I087c2c1885f86ff8163ce358e25dc3c092897223 --- swift/cli/manage_shard_ranges.py | 2 ++ test/unit/cli/test_manage_shard_ranges.py | 1 + 2 files changed, 3 insertions(+) diff --git a/swift/cli/manage_shard_ranges.py b/swift/cli/manage_shard_ranges.py index 6e48084e5b..591b46ac1c 100644 --- a/swift/cli/manage_shard_ranges.py +++ b/swift/cli/manage_shard_ranges.py @@ -524,6 +524,8 @@ def compact_shard_ranges(broker, args): _print_shard_range(donor, level=1) print('can be compacted into acceptor shard range:') _print_shard_range(acceptor, level=1) + print('Total of %d shard sequences identified for compaction.' + % len(compactible)) print('Once applied to the broker these changes will result in shard ' 'range compaction the next time the sharder runs.') diff --git a/test/unit/cli/test_manage_shard_ranges.py b/test/unit/cli/test_manage_shard_ranges.py index d6a646e9ab..47a83277ce 100644 --- a/test/unit/cli/test_manage_shard_ranges.py +++ b/test/unit/cli/test_manage_shard_ranges.py @@ -894,6 +894,7 @@ class TestManageShardRanges(unittest.TestCase): " '.shards_a", " objects: 100001, tombstones: 999, lower: 'obj79'", " state: active, upper: 'obj89'", + 'Total of 2 shard sequences identified for compaction.', 'Once applied to the broker these changes will result in ' 'shard range compaction the next time the sharder runs.', ]