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

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Fraser Tweedale 2017-01-25 10:51:24 +10:00 committed by Martin Basti
parent 980c8a5f9e
commit caca181d3b

View File

@ -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