def handle(self, request, data): share_name = _get_id_if_name_empty(data) try: result = manila.migration_get_progress(request, self.initial['share_id']) progress = result[1] messages.success( request, _('Migration of share %(name)s is at %(progress)s percent.') % {'name': share_name, 'progress': progress['total_progress']}) return True except Exception: exceptions.handle(request, _("Unable to obtain progress of " "migration of share %s at this " "moment.") % share_name) return False
def test_migration_get_progress(self): api.migration_get_progress(self.request, 'fake_share') (self.manilaclient.shares.migration_get_progress. assert_called_once_with('fake_share'))