From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4203F139085 for ; Thu, 26 Jan 2017 19:09:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 977AA141E5; Thu, 26 Jan 2017 19:09:20 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 764E0141E5 for ; Thu, 26 Jan 2017 19:09:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AE26D34105A for ; Thu, 26 Jan 2017 19:09:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7BBE6309D for ; Thu, 26 Jan 2017 19:09:18 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1485457734.9305bccfb29807f54a9dc514d3aea70639eb2c49.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/sync/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/emaint/modules/sync/sync.py X-VCS-Directories: pym/portage/emaint/modules/sync/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 9305bccfb29807f54a9dc514d3aea70639eb2c49 X-VCS-Branch: master Date: Thu, 26 Jan 2017 19:09:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: fad52cf1-b367-4c71-a40a-8aee7c9048ef X-Archives-Hash: 0866d3e8c8f8ac3fd30994c095605acb commit: 9305bccfb29807f54a9dc514d3aea70639eb2c49 Author: Alexandru Elisei gmail com> AuthorDate: Thu Jan 26 18:38:46 2017 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Jan 26 19:08:54 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9305bccf sync.py: set returncode when task failed in SyncScheduler._task_exit() If task.returncode is not os.EX_OK then returncode isn't defined when trying to append the (repo, returncode) tuple to self.retvals. This will raise an UnboundLocalError exception. This reverts the changes to the function made by commit f143e58. Fixes: f143e58dd3fd ("emaint: exit with non-zero status code when module fails (bug 567478)") pym/portage/emaint/modules/sync/sync.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pym/portage/emaint/modules/sync/sync.py b/pym/portage/emaint/modules/sync/sync.py index b190b3c..076297a 100644 --- a/pym/portage/emaint/modules/sync/sync.py +++ b/pym/portage/emaint/modules/sync/sync.py @@ -362,6 +362,7 @@ class SyncScheduler(AsyncScheduler): # that hooks will be called in a backward-compatible manner # even if all sync tasks have failed. hooks_enabled = True + returncode = task.returncode if task.returncode == os.EX_OK: returncode, message, updatecache_flg, hooks_enabled = task.result if message: