Martin Peřina has posted comments on this change. Change subject: engine: Add Upgrade host command ......................................................................
Patch Set 9: (2 comments) https://gerrit.ovirt.org/#/c/40462/9/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/hostdeploy/HostUpgradeCallback.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/hostdeploy/HostUpgradeCallback.java: Line 89: rootCommand.setCommandStatus(CommandStatus.FAILED); Line 90: } Line 91: Line 92: break; Line 93: } Please reformat ("case" should be indented more then "switch"): switch (host.getStatus()) { // Wait till moving to maintenance ends case PreparingForMaintenance: break; // Invoke the upgrade action case Maintenance: log.info("Host '{}' is on maintenance mode. Proceeding with Upgrade process.", getHostName(parameters.getVdsId())); invokeHostUpgrade(rootCommand, parameters); break; // Any other status implies maintenance action failed, and the callback cannot proceed with the upgrade default: if (isMaintenanceCommandExecuted(childCmdIds)) { log.info("Host '{}' failed to move to maintenance mode. Upgrade process is terminated.", getHostName(parameters.getVdsId())); rootCommand.setCommandStatus(CommandStatus.FAILED); } break; } Line 94: } Line 95: Line 96: /** Line 97: * Evaluates the progress of the {@code UpgradeHostInternalCommand} and updates root command status accordingly Line 121: case SUCCEEDED: Line 122: rootCommand.setCommandStatus(CommandStatus.SUCCEEDED); Line 123: return true; Line 124: } Line 125: } Please reformat ("case" should be indented more then "switch"): switch (upgradeCommand.getCommandStatus()) { case ACTIVE: case NOT_STARTED: return false; case FAILED: case FAILED_RESTARTED: case UNKNOWN: rootCommand.setCommandStatus(CommandStatus.FAILED); return true; case SUCCEEDED: rootCommand.setCommandStatus(CommandStatus.SUCCEEDED); return true; } Line 126: Line 127: return false; Line 128: } Line 129: -- To view, visit https://gerrit.ovirt.org/40462 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a1447f3ebb5a7e3a67a8c68d449ae61e29f97fc Gerrit-PatchSet: 9 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Martin Peřina <mper...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: Ravi Nori <rn...@redhat.com> Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches