Merge "Fix Share Migration KeyError on dict.pop"

This commit is contained in:
Jenkins 2016-03-14 18:26:16 +00:00 committed by Gerrit Code Review
commit 4b575e3282
2 changed files with 3 additions and 2 deletions

View File

@ -104,7 +104,7 @@ class DataManager(manager.Manager):
context, share_ref, share_instance_id, dest_share_instance_id)
raise exception.ShareDataCopyFailed(reason=msg)
finally:
self.busy_tasks_shares.pop(share_id)
self.busy_tasks_shares.pop(share_id, None)
LOG.info(_LI(
"Completed copy operation of migrating share content from share "

View File

@ -86,7 +86,8 @@ class DataManagerTestCase(test.TestCase):
self.mock_object(data_utils, 'Copy',
mock.Mock(return_value='fake_copy'))
self.manager.busy_tasks_shares[self.share['id']] = 'fake_copy'
if exc is None:
self.manager.busy_tasks_shares[self.share['id']] = 'fake_copy'
self.mock_object(self.manager, '_copy_share_data',
mock.Mock(side_effect=exc))