diff options
| author | Jan Cholasta <jcholast@redhat.com> | 2015-12-14 12:46:48 +0100 |
|---|---|---|
| committer | Tomas Babej <tbabej@redhat.com> | 2015-12-14 14:46:45 +0100 |
| commit | c856401478ce2f4fdd9cd7192afd18704f78e2e6 (patch) | |
| tree | 8744d0c4e84d4fa13d35706f921e6e533f1ce840 | |
| parent | f49cdfe392ede96152015ef95823c497e902aa17 (diff) | |
| download | freeipa-c856401478ce2f4fdd9cd7192afd18704f78e2e6.tar.gz freeipa-c856401478ce2f4fdd9cd7192afd18704f78e2e6.tar.xz freeipa-c856401478ce2f4fdd9cd7192afd18704f78e2e6.zip | |
server install: redirect ipa-client-install output to standard output
https://fedorahosted.org/freeipa/ticket/5527
Reviewed-By: Tomas Babej <tbabej@redhat.com>
| -rw-r--r-- | ipaserver/install/server/install.py | 13 | ||||
| -rw-r--r-- | ipaserver/install/server/replicainstall.py | 18 |
2 files changed, 15 insertions, 16 deletions
diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py index 540ce20bd..a07ca664e 100644 --- a/ipaserver/install/server/install.py +++ b/ipaserver/install/server/install.py @@ -991,10 +991,10 @@ def install(installer): args.append("--no-sshd") if options.mkhomedir: args.append("--mkhomedir") - run(args) + run(args, redirect_output=True) + print() except Exception as e: - sys.exit("Configuration of client side components failed!\n" - "ipa-client-install returned: " + str(e)) + sys.exit("Configuration of client side components failed!") # Everything installed properly, activate ipa service. services.knownservices.ipa.enable() @@ -1251,13 +1251,12 @@ def uninstall(installer): try: result = run([paths.IPA_CLIENT_INSTALL, "--on-master", "--unattended", "--uninstall"], - raiseonerr=False, capture_output=True) + raiseonerr=False, redirect_output=True) if result.returncode not in [0, 2]: - raise RuntimeError(result.output) - except Exception as e: + raise RuntimeError("Failed to configure the client") + except Exception: rv = 1 print("Uninstall of client side components failed!") - print("ipa-client-install returned: " + str(e)) sys.exit(rv) diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py index d62edd17d..c6927a5d9 100644 --- a/ipaserver/install/server/replicainstall.py +++ b/ipaserver/install/server/replicainstall.py @@ -409,7 +409,8 @@ def uninstall_client(): print("Removing client side components") ipautil.run([paths.IPA_CLIENT_INSTALL, "--unattended", "--uninstall"], - raiseonerr=False) + raiseonerr=False, redirect_output=True) + print() def promote_sssd(host_name): @@ -794,10 +795,10 @@ def install(installer): args.append("--no-sshd") if options.mkhomedir: args.append("--mkhomedir") - ipautil.run(args) - except Exception as e: + ipautil.run(args, redirect_output=True) + print() + except Exception: print("Configuration of client side components failed!") - print("ipa-client-install returned: " + str(e)) raise RuntimeError("Failed to configure the client") ds.replica_populate() @@ -859,11 +860,10 @@ def ensure_enrolled(installer): if installer.mkhomedir: args.append("--mkhomedir") - ipautil.run(args, stdin=stdin) - - except Exception as e: - sys.exit("Configuration of client side components failed!\n" - "ipa-client-install returned: " + str(e)) + ipautil.run(args, stdin=stdin, redirect_output=True) + print() + except Exception: + sys.exit("Configuration of client side components failed!") @common_cleanup @preserve_enrollment_state |
