Skip to content

Commit

Permalink
build: fix build failure after merge-forward
Browse files Browse the repository at this point in the history
  • Loading branch information
weizhouapache committed Apr 17, 2024
1 parent 63a0797 commit 38ca11f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
package com.cloud.hypervisor.kvm.resource;

import com.cloud.resource.AgentStatusUpdater;
import org.apache.log4j.Logger;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.libvirt.Domain;
import org.libvirt.LibvirtException;
import org.libvirt.event.DomainEvent;
Expand All @@ -24,7 +25,7 @@
import org.libvirt.event.StoppedDetail;

public class LibvirtDomainListener implements LifecycleListener {
private static final Logger LOGGER = Logger.getLogger(LibvirtDomainListener.class);
private static final Logger LOGGER = LogManager.getLogger(LibvirtDomainListener.class);

private final AgentStatusUpdater agentStatusUpdater;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.apache.cloudstack.utils.qemu.QemuObject.EncryptFormat;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.libvirt.LibvirtException;

import java.io.IOException;
Expand All @@ -53,8 +52,6 @@
@ResourceWrapper(handles = CheckAndRepairVolumeCommand.class)
public class LibvirtCheckAndRepairVolumeCommandWrapper extends CommandWrapper<CheckAndRepairVolumeCommand, Answer, LibvirtComputingResource> {

private static final Logger s_logger = Logger.getLogger(LibvirtCheckAndRepairVolumeCommandWrapper.class);

@Override
public Answer execute(CheckAndRepairVolumeCommand command, LibvirtComputingResource serverResource) {
final String volumeId = command.getPath();
Expand Down Expand Up @@ -105,7 +102,7 @@ private CheckAndRepairVolumeAnswer checkVolume(KVMPhysicalDisk vol, CheckAndRepa
EncryptFormat encryptFormat = EncryptFormat.enumValue(command.getEncryptFormat());
byte[] passphrase = command.getPassphrase();
String checkVolumeResult = checkAndRepairVolume(vol, null, encryptFormat, passphrase, serverResource);
s_logger.info(String.format("Check Volume result for the volume %s is %s", vol.getName(), checkVolumeResult));
logger.info(String.format("Check Volume result for the volume %s is %s", vol.getName(), checkVolumeResult));
CheckAndRepairVolumeAnswer answer = new CheckAndRepairVolumeAnswer(command, true, checkVolumeResult);
answer.setVolumeCheckExecutionResult(checkVolumeResult);

Expand All @@ -119,7 +116,7 @@ private CheckAndRepairVolumeAnswer repairVolume(KVMPhysicalDisk vol, CheckAndRep

String repairVolumeResult = checkAndRepairVolume(vol, repair, encryptFormat, passphrase, serverResource);
String finalResult = (checkVolumeResult != null ? checkVolumeResult.concat(",") : "") + repairVolumeResult;
s_logger.info(String.format("Repair Volume result for the volume %s is %s", vol.getName(), repairVolumeResult));
logger.info(String.format("Repair Volume result for the volume %s is %s", vol.getName(), repairVolumeResult));

CheckAndRepairVolumeAnswer answer = new CheckAndRepairVolumeAnswer(command, true, finalResult);
answer.setVolumeRepairExecutionResult(repairVolumeResult);
Expand All @@ -138,7 +135,7 @@ private CheckAndRepairVolumeAnswer checkIfRepairLeaksIsRequired(CheckAndRepairVo
jsonNode = objectMapper.readTree(checkVolumeResult);
} catch (JsonProcessingException e) {
String msg = String.format("Error processing response %s during check volume %s", checkVolumeResult, e.getMessage());
s_logger.info(msg);
logger.info(msg);

return skipRepairVolumeCommand(command, checkVolumeResult, msg);
}
Expand All @@ -157,7 +154,7 @@ private CheckAndRepairVolumeAnswer checkIfRepairLeaksIsRequired(CheckAndRepairVo
}

private CheckAndRepairVolumeAnswer skipRepairVolumeCommand(CheckAndRepairVolumeCommand command, String checkVolumeResult, String msg) {
s_logger.info(msg);
logger.info(msg);
String jsonStringFormat = String.format("{ \"message\": \"%s\" }", msg);
String finalResult = (checkVolumeResult != null ? checkVolumeResult.concat(",") : "") + jsonStringFormat;
CheckAndRepairVolumeAnswer answer = new CheckAndRepairVolumeAnswer(command, true, finalResult);
Expand Down

0 comments on commit 38ca11f

Please sign in to comment.