merge conflict (in loggers)

This commit is contained in:
Daan Hoogland 2024-09-09 15:51:43 +02:00
parent abfa92928c
commit b068c68bff

View File

@ -154,8 +154,7 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
public KVMStoragePool createStoragePool(String name, String host, int port, String path, String userInfo, public KVMStoragePool createStoragePool(String name, String host, int port, String path, String userInfo,
Storage.StoragePoolType type, Map<String, String> details) Storage.StoragePoolType type, Map<String, String> details)
{ {
logger.debug(String.format( logger.debug("Linstor createStoragePool: name: '{}', host: '{}', path: {}, userinfo: {}", name, host, path, userInfo);
"Linstor createStoragePool: name: '%s', host: '%s', path: %s, userinfo: %s", name, host, path, userInfo));
LinstorStoragePool storagePool = new LinstorStoragePool(name, host, port, userInfo, type, this); LinstorStoragePool storagePool = new LinstorStoragePool(name, host, port, userInfo, type, this);
MapStorageUuidToStoragePool.put(name, storagePool); MapStorageUuidToStoragePool.put(name, storagePool);
@ -190,7 +189,7 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, QemuImg.PhysicalDiskFormat format, public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, QemuImg.PhysicalDiskFormat format,
Storage.ProvisioningType provisioningType, long size, byte[] passphrase) 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); final String rscName = getLinstorRscName(name);
LinstorStoragePool lpool = (LinstorStoragePool) pool; LinstorStoragePool lpool = (LinstorStoragePool) pool;
final DevelopersApi api = getLinstorAPI(pool); final DevelopersApi api = getLinstorAPI(pool);
@ -231,7 +230,7 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
throw new CloudRuntimeException("Linstor: viewResources didn't return resources or volumes."); throw new CloudRuntimeException("Linstor: viewResources didn't return resources or volumes.");
} }
} catch (ApiException apiEx) { } 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); throw new CloudRuntimeException(apiEx.getBestMessage(), apiEx);
} }
} }
@ -254,9 +253,8 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
rcm.setOverrideProps(props); rcm.setOverrideProps(props);
ApiCallRcList answers = api.resourceConnectionModify(rscName, inUseNode, localNodeName, rcm); ApiCallRcList answers = api.resourceConnectionModify(rscName, inUseNode, localNodeName, rcm);
if (answers.hasError()) { if (answers.hasError()) {
logger.error(String.format( logger.error("Unable to set protocol C and 'allow-two-primaries' on {}/{}/{}",
"Unable to set protocol C and 'allow-two-primaries' on %s/%s/%s", inUseNode, localNodeName, rscName);
inUseNode, localNodeName, rscName));
// do not fail here as adding allow-two-primaries property is only a problem while live migrating // do not fail here as adding allow-two-primaries property is only a problem while live migrating
} }
} }
@ -265,7 +263,7 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
@Override @Override
public boolean connectPhysicalDisk(String volumePath, KVMStoragePool pool, Map<String, String> details) 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) { if (volumePath == null) {
logger.warn("volumePath is null, ignoring"); logger.warn("volumePath is null, ignoring");
return false; return false;
@ -304,11 +302,10 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
rcm.deleteProps(deleteProps); rcm.deleteProps(deleteProps);
ApiCallRcList answers = api.resourceConnectionModify(rscName, localNodeName, inUseNode, rcm); ApiCallRcList answers = api.resourceConnectionModify(rscName, localNodeName, inUseNode, rcm);
if (answers.hasError()) { if (answers.hasError()) {
logger.error( logger.error("Failed to remove 'protocol' and 'allow-two-primaries' on {}/{}/{}: {}",
String.format("Failed to remove 'protocol' and 'allow-two-primaries' on %s/%s/%s: %s",
localNodeName, localNodeName,
inUseNode, inUseNode,
rscName, LinstorUtil.getBestErrorMessage(answers))); rscName, LinstorUtil.getBestErrorMessage(answers));
// do not fail here as removing allow-two-primaries property isn't fatal // do not fail here as removing allow-two-primaries property isn't fatal
} }
} }
@ -512,7 +509,7 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
@Override @Override
public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, KVMStoragePool destPools, int timeout, byte[] srcPassphrase, byte[] destPassphrase, Storage.ProvisioningType provisioningType) 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 QemuImg.PhysicalDiskFormat sourceFormat = disk.getFormat();
final String sourcePath = disk.getPath(); final String sourcePath = disk.getPath();
@ -526,11 +523,11 @@ public class LinstorStorageAdaptor implements StorageAdaptor {
try { try {
LinstorUtil.applyAuxProps(api, rscName, disk.getDispName(), disk.getVmName()); LinstorUtil.applyAuxProps(api, rscName, disk.getDispName(), disk.getVmName());
} catch (ApiException apiExc) { } 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()); 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()); final QemuImgFile destFile = new QemuImgFile(dstDisk.getPath());
destFile.setFormat(dstDisk.getFormat()); destFile.setFormat(dstDisk.getFormat());
destFile.setSize(disk.getVirtualSize()); destFile.setSize(disk.getVirtualSize());