client: move clean CCACHE to module

According 04b8575c52 cleaning CCACHE is
needed after installation. This commit moves this cleanup from
ipa-client-install to client.install() function

https://fedorahosted.org/freeipa/ticket/6392

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Martin Basti 2016-10-31 13:22:08 +01:00 committed by Jan Cholasta
parent 8cbbb53591
commit bbad08900b
2 changed files with 10 additions and 5 deletions

View File

@ -265,8 +265,3 @@ if __name__ == "__main__":
sys.exit(1)
except RuntimeError as e:
sys.exit(e)
finally:
try:
os.remove(client.CCACHE_FILE)
except Exception:
pass

View File

@ -2285,6 +2285,16 @@ def install_check(options):
def install(options):
try:
return _install(options)
finally:
try:
os.remove(CCACHE_FILE)
except Exception:
pass
def _install(options):
env = {'PATH': SECURE_PATH}
fstore = sysrestore.FileStore(paths.IPA_CLIENT_SYSRESTORE)