URL: https://github.com/freeipa/freeipa/pull/417
Author: frasertweedale
 Title: #417: private_ccache: yield ccache name
Action: opened

PR body:
"""
When using private_ccache, yield 'path' from the context manager.
This is cleaner than inspecting 'os.environ['KRB5CCNAME']' within
the context.

Part of: https://fedorahosted.org/freeipa/ticket/5011
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/417/head:pr417
git checkout pr417
From a8c504216571016be89f661a65eee9e4c580d082 Mon Sep 17 00:00:00 2001
From: Fraser Tweedale <ftwee...@redhat.com>
Date: Wed, 25 Jan 2017 10:51:24 +1000
Subject: [PATCH] private_ccache: yield ccache name

When using private_ccache, yield 'path' from the context manager.
This is cleaner than inspecting 'os.environ['KRB5CCNAME']' within
the context.

Part of: https://fedorahosted.org/freeipa/ticket/5011
---
 ipapython/ipautil.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index c8f87ef..c810adc 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -1300,7 +1300,7 @@ def private_ccache(path=None):
     os.environ['KRB5CCNAME'] = path
 
     try:
-        yield
+        yield path
     finally:
         if original_value is not None:
             os.environ['KRB5CCNAME'] = original_value
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to