Merge "SPDK: Report info in top-level volume_stats"

This commit is contained in:
Zuul 2020-09-24 02:22:13 +00:00 committed by Gerrit Code Review
commit ed1233f1a6
2 changed files with 8 additions and 1 deletions

View File

@ -527,6 +527,10 @@ class SpdkDriverTestCase(test.TestCase):
self.assertEqual(1, len(self.driver._stats['pools'])) self.assertEqual(1, len(self.driver._stats['pools']))
self.assertEqual("lvs_test", self.assertEqual("lvs_test",
self.driver._stats['pools'][0]['pool_name']) self.driver._stats['pools'][0]['pool_name'])
self.assertEqual('SPDK', self.driver._stats['volume_backend_name'])
self.assertEqual('Open Source', self.driver._stats['vendor_name'])
self.assertEqual('NVMe-oF', self.driver._stats['storage_protocol'])
self.assertIsNotNone(self.driver._stats['driver_version'])
def test__get_spdk_volume_name(self): def test__get_spdk_volume_name(self):
with mock.patch.object(self.driver, "_rpc_call", with mock.patch.object(self.driver, "_rpc_call",

View File

@ -89,7 +89,10 @@ class SPDKDriver(driver.VolumeDriver):
"""Retrieve stats info from volume group.""" """Retrieve stats info from volume group."""
LOG.debug('SPDK Updating volume stats') LOG.debug('SPDK Updating volume stats')
status = {} status = {'volume_backend_name': 'SPDK',
'vendor_name': 'Open Source',
'driver_version': self.VERSION,
'storage_protocol': 'NVMe-oF'}
pools_status = [] pools_status = []
self.lvs = [] self.lvs = []