Skip to content

Commit f362738

Browse files
committed
build: fix logger post forward-merge
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent b29ec2b commit f362738

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/volume/CheckAndRepairVolumeCmd.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
// under the License.
1717
package org.apache.cloudstack.api.command.user.volume;
1818

19-
import com.cloud.event.EventTypes;
20-
import com.cloud.exception.InvalidParameterValueException;
19+
import java.util.Arrays;
20+
2121
import org.apache.cloudstack.acl.RoleType;
2222
import org.apache.cloudstack.api.APICommand;
2323
import org.apache.cloudstack.api.ApiCommandResourceType;
@@ -29,21 +29,19 @@
2929
import org.apache.cloudstack.api.ServerApiException;
3030
import org.apache.cloudstack.api.response.VolumeResponse;
3131
import org.apache.cloudstack.context.CallContext;
32-
import org.apache.log4j.Logger;
3332

33+
import com.cloud.event.EventTypes;
34+
import com.cloud.exception.InvalidParameterValueException;
3435
import com.cloud.exception.ResourceAllocationException;
3536
import com.cloud.storage.Volume;
3637
import com.cloud.user.Account;
3738
import com.cloud.utils.Pair;
3839
import com.cloud.utils.StringUtils;
3940

40-
import java.util.Arrays;
41-
4241
@APICommand(name = "checkVolume", description = "Check the volume for any errors or leaks and also repairs when repair parameter is passed, this is currently supported for KVM only", responseObject = VolumeResponse.class, entityType = {Volume.class},
4342
since = "4.19.1",
4443
authorized = {RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User})
4544
public class CheckAndRepairVolumeCmd extends BaseAsyncCmd {
46-
public static final Logger s_logger = Logger.getLogger(CheckAndRepairVolumeCmd.class.getName());
4745

4846
private static final String s_name = "checkandrepairvolumeresponse";
4947

engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1967,7 +1967,7 @@ private void handleCheckAndRepairVolume(Volume vol, Long hostId) {
19671967
volService.checkAndRepairVolumeBasedOnConfig(volFactory.getVolume(vol.getId()), host);
19681968
} catch (Exception e) {
19691969
String volumeToString = getReflectOnlySelectedFields(vol);
1970-
s_logger.debug(String.format("Unable to check and repair volume [%s] on host [%s], due to %s.", volumeToString, host, e.getMessage()));
1970+
logger.debug(String.format("Unable to check and repair volume [%s] on host [%s], due to %s.", volumeToString, host, e.getMessage()));
19711971
}
19721972
}
19731973

engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -2788,7 +2788,7 @@ public void checkAndRepairVolumeBasedOnConfig(DataObject dataObject, Host host)
27882788
if (HypervisorType.KVM.equals(host.getHypervisorType()) && DataObjectType.VOLUME.equals(dataObject.getType())) {
27892789
VolumeInfo volumeInfo = volFactory.getVolume(dataObject.getId());
27902790
if (VolumeApiServiceImpl.AllowCheckAndRepairVolume.valueIn(volumeInfo.getPoolId())) {
2791-
s_logger.info(String.format("Trying to check and repair the volume %d", dataObject.getId()));
2791+
logger.info(String.format("Trying to check and repair the volume %d", dataObject.getId()));
27922792
String repair = CheckAndRepairVolumeCmd.RepairValues.LEAKS.name().toLowerCase();
27932793
CheckAndRepairVolumePayload payload = new CheckAndRepairVolumePayload(repair);
27942794
volumeInfo.addPayload(payload);
@@ -2822,15 +2822,15 @@ private Pair<String, String> checkAndRepairVolumeThroughHost(VolumeInfo volume,
28222822
grantAccess(volume, host, volume.getDataStore());
28232823
CheckAndRepairVolumeAnswer answer = (CheckAndRepairVolumeAnswer) _storageMgr.sendToPool(pool, new long[]{host.getId()}, command);
28242824
if (answer != null && answer.getResult()) {
2825-
s_logger.debug(String.format("Check volume response result: %s", answer.getDetails()));
2825+
logger.debug(String.format("Check volume response result: %s", answer.getDetails()));
28262826
return new Pair<>(answer.getVolumeCheckExecutionResult(), answer.getVolumeRepairExecutionResult());
28272827
} else {
28282828
String errMsg = (answer == null) ? null : answer.getDetails();
2829-
s_logger.debug(String.format("Failed to check and repair the volume with error %s", errMsg));
2829+
logger.debug(String.format("Failed to check and repair the volume with error %s", errMsg));
28302830
}
28312831

28322832
} catch (Exception e) {
2833-
s_logger.debug("sending check and repair volume command failed", e);
2833+
logger.debug("sending check and repair volume command failed", e);
28342834
} finally {
28352835
revokeAccess(volume, host, volume.getDataStore());
28362836
command.clearPassphrase();

plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -4801,7 +4801,7 @@ protected Answer execute(MigrateCommand cmd) {
48014801

48024802
return new MigrateAnswer(cmd, true, "migration succeeded", null);
48034803
} catch (Exception e) {
4804-
s_logger.info(String.format("migrate command for %s failed due to %s", vmName, e.getLocalizedMessage()));
4804+
logger.info(String.format("migrate command for %s failed due to %s", vmName, e.getLocalizedMessage()));
48054805
return new MigrateAnswer(cmd, false, createLogMessageException(e, cmd), null);
48064806
}
48074807
}

server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -4408,7 +4408,7 @@ private VolumeVO sendAttachVolumeCommand(UserVmVO vm, VolumeVO volumeToAttach, L
44084408
try {
44094409
volService.checkAndRepairVolumeBasedOnConfig(volFactory.getVolume(volumeToAttach.getId()), host);
44104410
} catch (Exception e) {
4411-
s_logger.debug(String.format("Unable to check and repair volume [%s] on host [%s], due to %s.", volumeToAttach.getName(), host, e.getMessage()));
4411+
logger.debug(String.format("Unable to check and repair volume [%s] on host [%s], due to %s.", volumeToAttach.getName(), host, e.getMessage()));
44124412
}
44134413

44144414
try {

0 commit comments

Comments
 (0)