commit:     b26d3aad771a6ca177228ba984c3c98130e3c60a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 23 18:17:54 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Oct 23 18:17:54 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b26d3aad

portage.data._get_global: fix UnboundLocalError

Since commit 1364fcd89384c9f60e6d72d7057dc00d8caba175, an
UnboundLocalError was triggered for portage_gid when userpriv was
enabled. This is fixed by using _get_global('portage_gid') to access
the variable value.

Fixes: 1364fcd89384 ("Support unprivileged mode for bug #433453.")
X-Gentoo-Bug: 433453
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=433453

---
 pym/portage/data.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/data.py b/pym/portage/data.py
index 3d91e48..3e03eef 100644
--- a/pym/portage/data.py
+++ b/pym/portage/data.py
@@ -157,7 +157,7 @@ def _get_global(k):
                        raise AssertionError('unknown name: %s' % k)
 
        elif k == 'userpriv_groups':
-               v = [portage_gid]
+               v = [_get_global('portage_gid')]
                if secpass >= 2:
                        # Get a list of group IDs for the portage user. Do not 
use
                        # grp.getgrall() since it is known to trigger spurious

Reply via email to