Alon Bar-Lev has uploaded a new change for review. Change subject: host-deploy: output stderr content as error in audit log ......................................................................
host-deploy: output stderr content as error in audit log Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1021222 Change-Id: If1cc9bf7e9e9875965fa4830c68e2a63d801b96b Signed-off-by: Alon Bar-Lev <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java 2 files changed, 16 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/79/20579/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java index 7548064..4607390 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsDeploy.java @@ -1083,11 +1083,15 @@ _vds.getHostName(), e ); - if (_failException == null) { throw e; } else { + _messages.post( + InstallerMessages.Severity.ERROR, + e.getMessage() + ); + log.errorFormat( "Error during host {0} install, prefering first exception", _vds.getHostName(), diff --git a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java index c235084..38ad759 100644 --- a/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java +++ b/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ssh/SSHDialog.java @@ -314,17 +314,22 @@ poutStdout, stderr ); - if (stderr.size() > 0) { - throw new IOException("Error messages during execution"); + } + catch (Exception e) { + if (stderr.size() == 0) { + throw e; } + + log.error( + "Swallowing exception as preferring stderr", + e + ); } finally { if (stderr.size() > 0) { - log.error( + throw new RuntimeException( String.format( - "SSH stderr during command %1$s:'%2$s': stderr: %3$s", - _client.getDisplayHost(), - command, + "Unexpected error during execution: %1$s", new String(stderr.toByteArray(), Charset.forName("UTF-8")) ) ); -- To view, visit http://gerrit.ovirt.org/20579 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1cc9bf7e9e9875965fa4830c68e2a63d801b96b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.3 Gerrit-Owner: Alon Bar-Lev <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
