mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
parent
bbad08900b
commit
b3786730e5
@ -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:
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user