Remove unused exception
Remove unused VolumeDriverException and unused import in cinderlib.py
This commit is contained in:
@@ -38,7 +38,6 @@ from oslo_utils import importutils
|
|||||||
import urllib3
|
import urllib3
|
||||||
|
|
||||||
import cinderlib
|
import cinderlib
|
||||||
from cinderlib import exception
|
|
||||||
from cinderlib import nos_brick
|
from cinderlib import nos_brick
|
||||||
from cinderlib import objects
|
from cinderlib import objects
|
||||||
from cinderlib import persistence
|
from cinderlib import persistence
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ VolumeNotFound = exception.VolumeNotFound
|
|||||||
SnapshotNotFound = exception.SnapshotNotFound
|
SnapshotNotFound = exception.SnapshotNotFound
|
||||||
ConnectionNotFound = exception.VolumeAttachmentNotFound
|
ConnectionNotFound = exception.VolumeAttachmentNotFound
|
||||||
InvalidVolume = exception.InvalidVolume
|
InvalidVolume = exception.InvalidVolume
|
||||||
VolumeDriverException = exception.VolumeDriverException
|
|
||||||
|
|
||||||
|
|
||||||
class InvalidPersistence(Exception):
|
class InvalidPersistence(Exception):
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ class TestCinderlib(base.BaseTest):
|
|||||||
driver_cfg = {'k': 'v', 'k2': 'v2', 'volume_backend_name': 'Test'}
|
driver_cfg = {'k': 'v', 'k2': 'v2', 'volume_backend_name': 'Test'}
|
||||||
cinderlib.Backend.global_initialization = False
|
cinderlib.Backend.global_initialization = False
|
||||||
driver = mock_import.return_value
|
driver = mock_import.return_value
|
||||||
driver.get_volume_stats.return_value = {
|
driver.capabilities = {'pools': [{'pool_name': 'default'}]}
|
||||||
'pools': [{'pool_name': 'default'}]}
|
|
||||||
|
|
||||||
backend = objects.Backend(**driver_cfg)
|
backend = objects.Backend(**driver_cfg)
|
||||||
|
|
||||||
@@ -62,7 +61,7 @@ class TestCinderlib(base.BaseTest):
|
|||||||
driver.set_initialized.assert_called_once_with()
|
driver.set_initialized.assert_called_once_with()
|
||||||
self.assertEqual(driver_cfg, backend._driver_cfg)
|
self.assertEqual(driver_cfg, backend._driver_cfg)
|
||||||
self.assertIsNone(backend._volumes)
|
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)
|
self.assertEqual(('default',), backend.pool_names)
|
||||||
|
|
||||||
@mock.patch('urllib3.disable_warnings')
|
@mock.patch('urllib3.disable_warnings')
|
||||||
|
|||||||
Reference in New Issue
Block a user