Skip to content

Commit

Permalink
merge conflict (in loggers)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanHoogland committed Sep 9, 2024
1 parent abfa929 commit b068c68
Showing 1 changed file with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ public KVMPhysicalDisk getPhysicalDisk(String name, KVMStoragePool pool)
public KVMStoragePool createStoragePool(String name, String host, int port, String path, String userInfo,
Storage.StoragePoolType type, Map<String, String> details)
{
logger.debug(String.format(
"Linstor createStoragePool: name: '%s', host: '%s', path: %s, userinfo: %s", name, host, path, userInfo));
logger.debug("Linstor createStoragePool: name: '{}', host: '{}', path: {}, userinfo: {}", name, host, path, userInfo);
LinstorStoragePool storagePool = new LinstorStoragePool(name, host, port, userInfo, type, this);

MapStorageUuidToStoragePool.put(name, storagePool);
Expand Down Expand Up @@ -190,7 +189,7 @@ private void makeResourceAvailable(DevelopersApi api, String rscName, boolean di
public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, QemuImg.PhysicalDiskFormat format,
Storage.ProvisioningType provisioningType, long size, byte[] passphrase)
{
logger.debug(String.format("Linstor.createPhysicalDisk: %s;%s", name, format));
logger.debug("Linstor.createPhysicalDisk: {};{}", name, format);
final String rscName = getLinstorRscName(name);
LinstorStoragePool lpool = (LinstorStoragePool) pool;
final DevelopersApi api = getLinstorAPI(pool);
Expand Down Expand Up @@ -231,7 +230,7 @@ public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, Qemu
throw new CloudRuntimeException("Linstor: viewResources didn't return resources or volumes.");
}
} catch (ApiException apiEx) {
logger.error(String.format("Linstor.createPhysicalDisk: ApiException: %s", apiEx.getBestMessage()));
logger.error("Linstor.createPhysicalDisk: ApiException: {}", apiEx.getBestMessage());
throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);
}
}
Expand All @@ -254,9 +253,8 @@ private void allow2PrimariesIfInUse(DevelopersApi api, String rscName) throws Ap
rcm.setOverrideProps(props);
ApiCallRcList answers = api.resourceConnectionModify(rscName, inUseNode, localNodeName, rcm);
if (answers.hasError()) {
logger.error(String.format(
"Unable to set protocol C and 'allow-two-primaries' on %s/%s/%s",
inUseNode, localNodeName, rscName));
logger.error("Unable to set protocol C and 'allow-two-primaries' on {}/{}/{}",
inUseNode, localNodeName, rscName);
// do not fail here as adding allow-two-primaries property is only a problem while live migrating
}
}
Expand All @@ -265,7 +263,7 @@ private void allow2PrimariesIfInUse(DevelopersApi api, String rscName) throws Ap
@Override
public boolean connectPhysicalDisk(String volumePath, KVMStoragePool pool, Map<String, String> details)
{
logger.debug(String.format("Linstor: connectPhysicalDisk %s:%s -> %s", pool.getUuid(), volumePath, details));
logger.debug("Linstor: connectPhysicalDisk {}:{} -> {}", pool.getUuid(), volumePath, details);
if (volumePath == null) {
logger.warn("volumePath is null, ignoring");
return false;
Expand Down Expand Up @@ -304,11 +302,10 @@ private void removeTwoPrimariesRcProps(DevelopersApi api, String inUseNode, Stri
rcm.deleteProps(deleteProps);
ApiCallRcList answers = api.resourceConnectionModify(rscName, localNodeName, inUseNode, rcm);
if (answers.hasError()) {
logger.error(
String.format("Failed to remove 'protocol' and 'allow-two-primaries' on %s/%s/%s: %s",
logger.error("Failed to remove 'protocol' and 'allow-two-primaries' on {}/{}/{}: {}",
localNodeName,
inUseNode,
rscName, LinstorUtil.getBestErrorMessage(answers)));
rscName, LinstorUtil.getBestErrorMessage(answers));
// do not fail here as removing allow-two-primaries property isn't fatal
}
}
Expand Down Expand Up @@ -512,7 +509,7 @@ private boolean resourceSupportZeroBlocks(KVMStoragePool destPool, String resNam
@Override
public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, KVMStoragePool destPools, int timeout, byte[] srcPassphrase, byte[] destPassphrase, Storage.ProvisioningType provisioningType)
{
logger.debug(String.format("Linstor.copyPhysicalDisk: %s -> %s", disk.getPath(), name));
logger.debug("Linstor.copyPhysicalDisk: {} -> {}", disk.getPath(), name);
final QemuImg.PhysicalDiskFormat sourceFormat = disk.getFormat();
final String sourcePath = disk.getPath();

Expand All @@ -526,11 +523,11 @@ public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, KVMSt
try {
LinstorUtil.applyAuxProps(api, rscName, disk.getDispName(), disk.getVmName());
} catch (ApiException apiExc) {
s_logger.error(String.format("Error setting aux properties for %s", rscName));
logger.error("Error setting aux properties for {}", rscName);
logLinstorAnswers(apiExc.getApiCallRcList());
}

logger.debug(String.format("Linstor.copyPhysicalDisk: dstPath: %s", dstDisk.getPath()));
logger.debug("Linstor.copyPhysicalDisk: dstPath: {}", dstDisk.getPath());
final QemuImgFile destFile = new QemuImgFile(dstDisk.getPath());
destFile.setFormat(dstDisk.getFormat());
destFile.setSize(disk.getVirtualSize());
Expand Down

0 comments on commit b068c68

Please sign in to comment.