Remove unused exception
Remove unused VolumeDriverException and unused import in cinderlib.py
This commit is contained in:
parent
6f0e451c83
commit
e314e6d431
|
@ -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
|
||||
|
|
|
@ -21,7 +21,6 @@ VolumeNotFound = exception.VolumeNotFound
|
|||
SnapshotNotFound = exception.SnapshotNotFound
|
||||
ConnectionNotFound = exception.VolumeAttachmentNotFound
|
||||
InvalidVolume = exception.InvalidVolume
|
||||
VolumeDriverException = exception.VolumeDriverException
|
||||
|
||||
|
||||
class InvalidPersistence(Exception):
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue