build: fix logger post forward-merge

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2024-03-01 18:14:54 +05:30
parent b29ec2bf12
commit f36273888b
5 changed files with 11 additions and 13 deletions

View File

@ -16,8 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.volume;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import java.util.Arrays;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandResourceType;
@ -29,21 +29,19 @@ import org.apache.cloudstack.api.ResponseObject.ResponseView;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.VolumeResponse;
import org.apache.cloudstack.context.CallContext;
import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.storage.Volume;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
import com.cloud.utils.StringUtils;
import java.util.Arrays;
@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},
since = "4.19.1",
authorized = {RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User})
public class CheckAndRepairVolumeCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(CheckAndRepairVolumeCmd.class.getName());
private static final String s_name = "checkandrepairvolumeresponse";

View File

@ -1967,7 +1967,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
volService.checkAndRepairVolumeBasedOnConfig(volFactory.getVolume(vol.getId()), host);
} catch (Exception e) {
String volumeToString = getReflectOnlySelectedFields(vol);
s_logger.debug(String.format("Unable to check and repair volume [%s] on host [%s], due to %s.", volumeToString, host, e.getMessage()));
logger.debug(String.format("Unable to check and repair volume [%s] on host [%s], due to %s.", volumeToString, host, e.getMessage()));
}
}

View File

@ -2788,7 +2788,7 @@ public class VolumeServiceImpl implements VolumeService {
if (HypervisorType.KVM.equals(host.getHypervisorType()) && DataObjectType.VOLUME.equals(dataObject.getType())) {
VolumeInfo volumeInfo = volFactory.getVolume(dataObject.getId());
if (VolumeApiServiceImpl.AllowCheckAndRepairVolume.valueIn(volumeInfo.getPoolId())) {
s_logger.info(String.format("Trying to check and repair the volume %d", dataObject.getId()));
logger.info(String.format("Trying to check and repair the volume %d", dataObject.getId()));
String repair = CheckAndRepairVolumeCmd.RepairValues.LEAKS.name().toLowerCase();
CheckAndRepairVolumePayload payload = new CheckAndRepairVolumePayload(repair);
volumeInfo.addPayload(payload);
@ -2822,15 +2822,15 @@ public class VolumeServiceImpl implements VolumeService {
grantAccess(volume, host, volume.getDataStore());
CheckAndRepairVolumeAnswer answer = (CheckAndRepairVolumeAnswer) _storageMgr.sendToPool(pool, new long[]{host.getId()}, command);
if (answer != null && answer.getResult()) {
s_logger.debug(String.format("Check volume response result: %s", answer.getDetails()));
logger.debug(String.format("Check volume response result: %s", answer.getDetails()));
return new Pair<>(answer.getVolumeCheckExecutionResult(), answer.getVolumeRepairExecutionResult());
} else {
String errMsg = (answer == null) ? null : answer.getDetails();
s_logger.debug(String.format("Failed to check and repair the volume with error %s", errMsg));
logger.debug(String.format("Failed to check and repair the volume with error %s", errMsg));
}
} catch (Exception e) {
s_logger.debug("sending check and repair volume command failed", e);
logger.debug("sending check and repair volume command failed", e);
} finally {
revokeAccess(volume, host, volume.getDataStore());
command.clearPassphrase();

View File

@ -4801,7 +4801,7 @@ public class VmwareResource extends ServerResourceBase implements StoragePoolRes
return new MigrateAnswer(cmd, true, "migration succeeded", null);
} catch (Exception e) {
s_logger.info(String.format("migrate command for %s failed due to %s", vmName, e.getLocalizedMessage()));
logger.info(String.format("migrate command for %s failed due to %s", vmName, e.getLocalizedMessage()));
return new MigrateAnswer(cmd, false, createLogMessageException(e, cmd), null);
}
}

View File

@ -4408,7 +4408,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
try {
volService.checkAndRepairVolumeBasedOnConfig(volFactory.getVolume(volumeToAttach.getId()), host);
} catch (Exception e) {
s_logger.debug(String.format("Unable to check and repair volume [%s] on host [%s], due to %s.", volumeToAttach.getName(), host, e.getMessage()));
logger.debug(String.format("Unable to check and repair volume [%s] on host [%s], due to %s.", volumeToAttach.getName(), host, e.getMessage()));
}
try {