From bbad08900bbe8f76e59b159cd2af800f5c089ca1 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Nov 11 2016 11:13:56 +0000 Subject: client: move clean CCACHE to module According 04b8575c52410bb6d31e0e55f1cf431d7cc9c7c3 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 --- diff --git a/client/ipa-client-install b/client/ipa-client-install index ecb3a14..98b2aa1 100755 --- a/client/ipa-client-install +++ b/client/ipa-client-install @@ -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 diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py index 95d8fce..440475b 100644 --- a/ipaclient/install/client.py +++ b/ipaclient/install/client.py @@ -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)