def handle(self, request, data): share_name = _get_id_if_name_empty(data) try: manila.migration_cancel(request, self.initial['share_id']) messages.success( request, _('Successfully sent the request to cancel migration of ' ' share: %s.') % share_name) return True except Exception: exceptions.handle(request, _("Unable to cancel migration of share" " %s at this moment.") % share_name) return False
def test_migration_cancel(self): api.migration_cancel(self.request, 'fake_share') self.manilaclient.shares.migration_cancel.assert_called_once_with( 'fake_share')