Source:
<code>private void processPmAction(Pair<VDS, VDSStatus> action) { VDS vds = action.getFirst(); VDSStatus currentStatus = vds.getStatus(); VDSStatus targetStatus = action.getSecond(); if (targetStatus == VDSStatus.Maintenance && currentStatus == VDSStatus.Up) { logAction(vds, AuditLogType.PM_POLICY_UP_TO_MAINTENANCE); <START> List<Guid> vdsList = new ArrayList<>(1); <END> vdsList.add(vds.getId()); MaintenanceNumberOfVdssParameters parameters = new MaintenanceNumberOfVdssParameters(vdsList, true, true); Backend.getInstance().runInternalAction(VdcActionType.MaintenanceNumberOfVdss, parameters, ExecutionHandler.createInternalJobContext()); } else if (targetStatus == VDSStatus.Down && currentStatus == VDSStatus.Maintenance) { logAction(vds, AuditLogType.PM_POLICY_MAINTENANCE_TO_DOWN); FenceVdsActionParameters parameters = new FenceVdsActionParameters(vds.getId(), FenceActionType.Stop, true); Backend.getInstance().runInternalAction(VdcActionType.StopVds, parameters, ExecutionHandler.createInternalJobContext()); } else if (targetStatus == VDSStatus.Up && currentStatus == VDSStatus.Maintenance) { logAction(vds, AuditLogType.PM_POLICY_TO_UP); VdsActionParameters parameters = new VdsActionParameters(vds.getId()); Backend.getInstance().runInternalAction(VdcActionType.ActivateVds, parameters, ExecutionHandler.createInternalJobContext()); } else if (targetStatus == VDSStatus.Up && currentStatus == VDSStatus.Down) { logAction(vds, AuditLogType.PM_POLICY_TO_UP); FenceVdsActionParameters parameters = new FenceVdsActionParameters(vds.getId(), FenceActionType.Start); Backend.getInstance().runInternalAction(VdcActionType.StartVds, parameters, ExecutionHandler.createInternalJobContext()); } else { } }</code><technical_language>remove 1</technical_language>

Target:
private void processPmAction(Pair<VDS, VDSStatus> action) { VDS vds = action.getFirst(); VDSStatus currentStatus = vds.getStatus(); VDSStatus targetStatus = action.getSecond(); if (targetStatus == VDSStatus.Maintenance && currentStatus == VDSStatus.Up) { logAction(vds, AuditLogType.PM_POLICY_UP_TO_MAINTENANCE); List<Guid> vdsList = new ArrayList<>(1); vdsList.add(vds.getId()); MaintenanceNumberOfVdssParameters parameters = new MaintenanceNumberOfVdssParameters(vdsList, true, true); Backend.getInstance().runInternalAction(VdcActionType.MaintenanceNumberOfVdss, parameters, ExecutionHandler.createInternalJobContext()); } else if (targetStatus == VDSStatus.Down && currentStatus == VDSStatus.Maintenance) { logAction(vds, AuditLogType.PM_POLICY_MAINTENANCE_TO_DOWN); FenceVdsActionParameters parameters = new FenceVdsActionParameters(vds.getId(), FenceActionType.Stop, true); Backend.getInstance().runInternalAction(VdcActionType.StopVds, parameters, ExecutionHandler.createInternalJobContext()); } else if (targetStatus == VDSStatus.Up && currentStatus == VDSStatus.Maintenance) { logAction(vds, AuditLogType.PM_POLICY_TO_UP); VdsActionParameters parameters = new VdsActionParameters(vds.getId()); Backend.getInstance().runInternalAction(VdcActionType.ActivateVds, parameters, ExecutionHandler.createInternalJobContext()); } else if (targetStatus == VDSStatus.Up && currentStatus == VDSStatus.Down) { logAction(vds, AuditLogType.PM_POLICY_TO_UP); FenceVdsActionParameters parameters = new FenceVdsActionParameters(vds.getId(), FenceActionType.Start); Backend.getInstance().runInternalAction(VdcActionType.StartVds, parameters, ExecutionHandler.createInternalJobContext()); } else { log.errorFormat("Unknown host power management transition {0} -> {1}", currentStatus.toString(), targetStatus.toString()); } }