Merge "Eqlx: Ignore missing snapshot on delete"
This commit is contained in:
commit
6d253caaf4
cinder
@ -238,6 +238,17 @@ class DellEQLSanISCSIDriverTestCase(test.TestCase):
|
|||||||
mock_eql_execute.configure_mock(**mock_attrs)
|
mock_eql_execute.configure_mock(**mock_attrs)
|
||||||
self.driver.delete_snapshot(snapshot)
|
self.driver.delete_snapshot(snapshot)
|
||||||
|
|
||||||
|
def test_delete_absent_snapshot(self):
|
||||||
|
snapshot = {'name': 'fakesnap', 'volume_name': 'fakevolume_name'}
|
||||||
|
mock_attrs = {'args': ['volume', 'select', snapshot['volume_name'],
|
||||||
|
'snapshot', 'delete', snapshot['name']]}
|
||||||
|
with mock.patch.object(self.driver,
|
||||||
|
'_eql_execute') as mock_eql_execute:
|
||||||
|
mock_eql_execute.configure_mock(**mock_attrs)
|
||||||
|
mock_eql_execute.side_effect = processutils.ProcessExecutionError(
|
||||||
|
stdout='% Error ..... does not exist.\n')
|
||||||
|
self.driver.delete_snapshot(snapshot)
|
||||||
|
|
||||||
def test_extend_volume(self):
|
def test_extend_volume(self):
|
||||||
new_size = '200'
|
new_size = '200'
|
||||||
volume = {'name': self.volume_name, 'size': 100}
|
volume = {'name': self.volume_name, 'size': 100}
|
||||||
|
@ -566,6 +566,9 @@ class DellEQLSanISCSIDriver(san.SanISCSIDriver):
|
|||||||
try:
|
try:
|
||||||
self._eql_execute('volume', 'select', snapshot['volume_name'],
|
self._eql_execute('volume', 'select', snapshot['volume_name'],
|
||||||
'snapshot', 'delete', snapshot['name'])
|
'snapshot', 'delete', snapshot['name'])
|
||||||
|
except processutils.ProcessExecutionError as err:
|
||||||
|
if err.stdout.find('does not exist') > -1:
|
||||||
|
LOG.debug('Snapshot %s could not be found.', snapshot['name'])
|
||||||
except Exception:
|
except Exception:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
LOG.error(_LE('Failed to delete snapshot %(snap)s of '
|
LOG.error(_LE('Failed to delete snapshot %(snap)s of '
|
||||||
|
Loading…
x
Reference in New Issue
Block a user