diff --git a/cinderlib/cinderlib.py b/cinderlib/cinderlib.py index eb721a0..3feefed 100644 --- a/cinderlib/cinderlib.py +++ b/cinderlib/cinderlib.py @@ -38,7 +38,6 @@ from oslo_utils import importutils import urllib3 import cinderlib -from cinderlib import exception from cinderlib import nos_brick from cinderlib import objects from cinderlib import persistence diff --git a/cinderlib/exception.py b/cinderlib/exception.py index 9915740..798934f 100644 --- a/cinderlib/exception.py +++ b/cinderlib/exception.py @@ -21,7 +21,6 @@ VolumeNotFound = exception.VolumeNotFound SnapshotNotFound = exception.SnapshotNotFound ConnectionNotFound = exception.VolumeAttachmentNotFound InvalidVolume = exception.InvalidVolume -VolumeDriverException = exception.VolumeDriverException class InvalidPersistence(Exception): diff --git a/cinderlib/tests/unit/test_cinderlib.py b/cinderlib/tests/unit/test_cinderlib.py index 30cc0c0..7211b2a 100644 --- a/cinderlib/tests/unit/test_cinderlib.py +++ b/cinderlib/tests/unit/test_cinderlib.py @@ -37,8 +37,7 @@ class TestCinderlib(base.BaseTest): driver_cfg = {'k': 'v', 'k2': 'v2', 'volume_backend_name': 'Test'} cinderlib.Backend.global_initialization = False driver = mock_import.return_value - driver.get_volume_stats.return_value = { - 'pools': [{'pool_name': 'default'}]} + driver.capabilities = {'pools': [{'pool_name': 'default'}]} backend = objects.Backend(**driver_cfg) @@ -62,7 +61,7 @@ class TestCinderlib(base.BaseTest): driver.set_initialized.assert_called_once_with() self.assertEqual(driver_cfg, backend._driver_cfg) self.assertIsNone(backend._volumes) - driver.get_volume_stats.assert_called_once_with(refresh=False) + driver.get_volume_stats.assert_not_called() self.assertEqual(('default',), backend.pool_names) @mock.patch('urllib3.disable_warnings')