Michael Kublin has posted comments on this change.
Change subject: core: Remove image when VDSM returns not exist.
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(1 inline comment)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveTemplateSnapshotCommand.java
Line 45: getParameters().getStorageDomainId()));
Line 46:
Line 47: setSucceeded(true);
Line 48: }
Line 49: } catch (VdcBLLException e) {
we have a following code in CommandBase:
private void processExceptionToClient(VdcFault fault) {
fault.setSessionID(getParameters().getSessionId());
_returnValue.getExecuteFailedMessages().add(fault.getError().name());
_returnValue.setFault(fault);
}
which is called from:
private boolean executeWithoutTransaction() {
boolean functionReturnValue = false;
boolean exceptionOccurred = true;
try {
logRunningCommand();
if (hasTaskHandlers()) {
getCurrentTaskHandler().execute();
} else {
executeCommand();
}
functionReturnValue = getSucceeded();
exceptionOccurred = false;
} catch (VdcBLLException e) {
log.error(String.format("Command %1$s throw Vdc Bll exception. With
error message %2$s",
getClass().getName(),
e.getMessage()));
if (log.isDebugEnabled()) {
log.debug(String.format("Command %1$s throw Vdc Bll exception",
getClass().getName()), e);
}
processExceptionToClient(new VdcFault(e,
e.getVdsError().getCode()));
} catch (RuntimeException e) {
processExceptionToClient(new VdcFault(e, VdcBllErrors.ENGINE));
log.error(String.format("Command %1$s throw exception",
getClass().getName()), e);
} finally {
// If we failed to execute due to exception or some other reason,
we compensate for the failure.
if (exceptionOccurred || !getSucceeded()) {
compensate();
} else {
cleanUpCompensationData();
}
}
return functionReturnValue;
}
I think it is means that following code is not required.
Line 50: if (e.getErrorCode() ==
VdcBllErrors.ImageDoesNotExistInDomainError) {
Line 51: getReturnValue().setFault(new VdcFault(e,
e.getErrorCode()));
Line 52: log.errorFormat("Image {0} does not exist in domain
{1}.",
Line 53: getDiskImage().getId(),
--
To view, visit http://gerrit.ovirt.org/12077
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I36915c44e65e20e3ce222683650a562603e4bb05
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: liron aravot <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches