diff --git a/swift/common/middleware/recon.py b/swift/common/middleware/recon.py index 695733e6aa..12f39a14ac 100644 --- a/swift/common/middleware/recon.py +++ b/swift/common/middleware/recon.py @@ -135,6 +135,7 @@ class ReconMiddleware(object): def get_sharding_info(self): """get sharding info""" return self._from_recon_cache(["sharding_stats", + "sharding_time", "sharding_last"], self.container_recon_cache) diff --git a/test/unit/common/middleware/test_recon.py b/test/unit/common/middleware/test_recon.py index af3d13daf0..71fcd0efef 100644 --- a/test/unit/common/middleware/test_recon.py +++ b/test/unit/common/middleware/test_recon.py @@ -1179,13 +1179,14 @@ class TestReconSuccess(TestCase): } }, }, + "sharding_time": 600, "sharding_last": 1614136398.6680582} self.fakecache.fakeout_calls = [] self.fakecache.fakeout = from_cache_response rv = self.app.get_sharding_info() - self.assertEqual(self.fakecache.fakeout_calls, - [((['sharding_stats', 'sharding_last'], - '/var/cache/swift/container.recon'), {})]) + self.assertEqual(self.fakecache.fakeout_calls, [ + ((['sharding_stats', 'sharding_time', 'sharding_last'], + '/var/cache/swift/container.recon'), {})]) self.assertEqual(rv, from_cache_response)