Merge "Fix AttributeError related to volume data check"
This commit is contained in:
commit
6f6d30e35f
|
@ -1,4 +1,4 @@
|
|||
# Copyright 2015 IBM Corp.
|
||||
# Copyright 2015, 2017 IBM Corp.
|
||||
#
|
||||
# All Rights Reserved.
|
||||
#
|
||||
|
@ -199,7 +199,6 @@ class TestLPM(test.TestCase):
|
|||
|
||||
def test_src_cleanup(self):
|
||||
vol_drv = mock.Mock()
|
||||
self.lpmdst.pre_live_vol_data = {}
|
||||
self.lpmdst.cleanup_volume(vol_drv)
|
||||
# Ensure the volume driver is not called
|
||||
self.assertEqual(0, vol_drv.cleanup_volume_at_destination.call_count)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright 2015, 2016 IBM Corp.
|
||||
# Copyright 2015, 2017 IBM Corp.
|
||||
#
|
||||
# All Rights Reserved.
|
||||
#
|
||||
|
@ -241,7 +241,7 @@ class LiveMigrationDest(LiveMigration):
|
|||
LOG.info(_LI('Performing detach for volume %(volume)s'),
|
||||
dict(volume=vol_drv.volume_id), instance=self.instance)
|
||||
# Ensure the volume data is present before trying cleanup
|
||||
if self.pre_live_vol_data:
|
||||
if hasattr(self, 'pre_live_vol_data'):
|
||||
try:
|
||||
vol_drv.cleanup_volume_at_destination(self.pre_live_vol_data)
|
||||
except Exception:
|
||||
|
|
Loading…
Reference in New Issue