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>
This commit is contained in:
Martin Basti authored and Jan Cholasta committed 2016-11-11 12:13:56 +01:00
1 parent bbad08900b
commit b3786730e5
2 files changed
+16 -18

No files matched your search

+1 -17
View File
@@ -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:
+15 -1
View File
@@ -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)