Doron Fediuck has posted comments on this change.
Change subject: core: cleanup MigrateVmCommand I
......................................................................
Patch Set 1: (1 inline comment)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java
Line 143: // succeeded false, rerun false = migration failed
Line 144: if(getSucceeded()) {
Line 145: return (VMStatus) getActionReturnValue() == VMStatus.Up ?
AuditLogType.VM_MIGRATION_DONE
Line 146: : AuditLogType.VM_MIGRATION_START;
Line 147: } else {
Excellent!!!
Now just one question, if you return in the above block, why do you need the
else?
Simply remove it and take out its internal condition:
if (xxx) {
return yyy
}
if (xxx2) {
...
}
else {
...
}
Isn't it clearer?
Line 148: if(_isRerun) {
Line 149: return AuditLogType.VM_MIGRATION_TRYING_RERUN;
Line 150: } else {
Line 151: return getVds().getstatus() ==
VDSStatus.PreparingForMaintenance ?
AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTANANCE
--
To view, visit http://gerrit.ovirt.org/7552
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8630df3887bc668edb2d34eb73d0295ae5289818
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches