summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2016-10-31 13:27:15 +0100
committerJan Cholasta <jcholast@redhat.com>2016-11-11 12:13:56 +0100
commitb3786730e50080fa4dadeffa86388592c10b3a62 (patch)
treee90113f3f21b38d060af3f4f8c1e740641893477
parentbbad08900bbe8f76e59b159cd2af800f5c089ca1 (diff)
downloadfreeipa-b3786730e50080fa4dadeffa86388592c10b3a62.tar.gz
freeipa-b3786730e50080fa4dadeffa86388592c10b3a62.tar.xz
freeipa-b3786730e50080fa4dadeffa86388592c10b3a62.zip
client: move install cleanup from ipa-client-install to module
Cleanup should be part of installation function https://fedorahosted.org/freeipa/ticket/6392 Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
-rwxr-xr-xclient/ipa-client-install18
-rw-r--r--ipaclient/install/client.py16
2 files changed, 16 insertions, 18 deletions
diff --git a/client/ipa-client-install b/client/ipa-client-install
index 98b2aa165..96aaf9aeb 100755
--- a/client/ipa-client-install
+++ b/client/ipa-client-install
@@ -240,23 +240,7 @@ def main():
if rval_check != client.SUCCESS:
return rval_check
- rval = client.install(options)
- if rval == client.CLIENT_INSTALL_ERROR:
- if options.force:
- root_logger.warning(
- "Installation failed. Force set so not rolling back changes.")
- elif options.on_master:
- root_logger.warning(
- "Installation failed. As this is IPA server, changes will not "
- "be rolled back."
- )
- else:
- root_logger.error("Installation failed. Rolling back changes.")
- options.unattended = True
- client.uninstall(options)
-
- return rval
-
+ return client.install(options)
if __name__ == "__main__":
try:
diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py
index 440475b94..4403283f2 100644
--- a/ipaclient/install/client.py
+++ b/ipaclient/install/client.py
@@ -2286,7 +2286,21 @@ def install_check(options):
def install(options):
try:
- return _install(options)
+ rval = _install(options)
+ if rval == CLIENT_INSTALL_ERROR:
+ if options.force:
+ root_logger.warning(
+ "Installation failed. Force set so not rolling back "
+ "changes.")
+ elif options.on_master:
+ root_logger.warning(
+ "Installation failed. As this is IPA server, changes will "
+ "not be rolled back.")
+ else:
+ root_logger.error("Installation failed. Rolling back changes.")
+ options.unattended = True
+ uninstall(options)
+ return rval
finally:
try:
os.remove(CCACHE_FILE)