@@ -154,8 +154,7 @@ public KVMPhysicalDisk getPhysicalDisk(String name, KVMStoragePool pool)
154154 public KVMStoragePool createStoragePool (String name , String host , int port , String path , String userInfo ,
155155 Storage .StoragePoolType type , Map <String , String > details )
156156 {
157- logger .debug (String .format (
158- "Linstor createStoragePool: name: '%s', host: '%s', path: %s, userinfo: %s" , name , host , path , userInfo ));
157+ logger .debug ("Linstor createStoragePool: name: '{}', host: '{}', path: {}, userinfo: {}" , name , host , path , userInfo );
159158 LinstorStoragePool storagePool = new LinstorStoragePool (name , host , port , userInfo , type , this );
160159
161160 MapStorageUuidToStoragePool .put (name , storagePool );
@@ -190,7 +189,7 @@ private void makeResourceAvailable(DevelopersApi api, String rscName, boolean di
190189 public KVMPhysicalDisk createPhysicalDisk (String name , KVMStoragePool pool , QemuImg .PhysicalDiskFormat format ,
191190 Storage .ProvisioningType provisioningType , long size , byte [] passphrase )
192191 {
193- logger .debug (String . format ( "Linstor.createPhysicalDisk: %s;%s " , name , format ) );
192+ logger .debug ("Linstor.createPhysicalDisk: {};{} " , name , format );
194193 final String rscName = getLinstorRscName (name );
195194 LinstorStoragePool lpool = (LinstorStoragePool ) pool ;
196195 final DevelopersApi api = getLinstorAPI (pool );
@@ -231,7 +230,7 @@ public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, Qemu
231230 throw new CloudRuntimeException ("Linstor: viewResources didn't return resources or volumes." );
232231 }
233232 } catch (ApiException apiEx ) {
234- logger .error (String . format ( "Linstor.createPhysicalDisk: ApiException: %s " , apiEx .getBestMessage () ));
233+ logger .error ("Linstor.createPhysicalDisk: ApiException: {} " , apiEx .getBestMessage ());
235234 throw new CloudRuntimeException (apiEx .getBestMessage (), apiEx );
236235 }
237236 }
@@ -254,9 +253,8 @@ private void allow2PrimariesIfInUse(DevelopersApi api, String rscName) throws Ap
254253 rcm .setOverrideProps (props );
255254 ApiCallRcList answers = api .resourceConnectionModify (rscName , inUseNode , localNodeName , rcm );
256255 if (answers .hasError ()) {
257- logger .error (String .format (
258- "Unable to set protocol C and 'allow-two-primaries' on %s/%s/%s" ,
259- inUseNode , localNodeName , rscName ));
256+ logger .error ("Unable to set protocol C and 'allow-two-primaries' on {}/{}/{}" ,
257+ inUseNode , localNodeName , rscName );
260258 // do not fail here as adding allow-two-primaries property is only a problem while live migrating
261259 }
262260 }
@@ -265,7 +263,7 @@ private void allow2PrimariesIfInUse(DevelopersApi api, String rscName) throws Ap
265263 @ Override
266264 public boolean connectPhysicalDisk (String volumePath , KVMStoragePool pool , Map <String , String > details )
267265 {
268- logger .debug (String . format ( "Linstor: connectPhysicalDisk %s:%s -> %s " , pool .getUuid (), volumePath , details ) );
266+ logger .debug ("Linstor: connectPhysicalDisk {}:{} -> {} " , pool .getUuid (), volumePath , details );
269267 if (volumePath == null ) {
270268 logger .warn ("volumePath is null, ignoring" );
271269 return false ;
@@ -304,11 +302,10 @@ private void removeTwoPrimariesRcProps(DevelopersApi api, String inUseNode, Stri
304302 rcm .deleteProps (deleteProps );
305303 ApiCallRcList answers = api .resourceConnectionModify (rscName , localNodeName , inUseNode , rcm );
306304 if (answers .hasError ()) {
307- logger .error (
308- String .format ("Failed to remove 'protocol' and 'allow-two-primaries' on %s/%s/%s: %s" ,
305+ logger .error ("Failed to remove 'protocol' and 'allow-two-primaries' on {}/{}/{}: {}" ,
309306 localNodeName ,
310307 inUseNode ,
311- rscName , LinstorUtil .getBestErrorMessage (answers ))) ;
308+ rscName , LinstorUtil .getBestErrorMessage (answers ));
312309 // do not fail here as removing allow-two-primaries property isn't fatal
313310 }
314311 }
@@ -512,7 +509,7 @@ private boolean resourceSupportZeroBlocks(KVMStoragePool destPool, String resNam
512509 @ Override
513510 public KVMPhysicalDisk copyPhysicalDisk (KVMPhysicalDisk disk , String name , KVMStoragePool destPools , int timeout , byte [] srcPassphrase , byte [] destPassphrase , Storage .ProvisioningType provisioningType )
514511 {
515- logger .debug (String . format ( "Linstor.copyPhysicalDisk: %s -> %s " , disk .getPath (), name ) );
512+ logger .debug ("Linstor.copyPhysicalDisk: {} -> {} " , disk .getPath (), name );
516513 final QemuImg .PhysicalDiskFormat sourceFormat = disk .getFormat ();
517514 final String sourcePath = disk .getPath ();
518515
@@ -526,11 +523,11 @@ public KVMPhysicalDisk copyPhysicalDisk(KVMPhysicalDisk disk, String name, KVMSt
526523 try {
527524 LinstorUtil .applyAuxProps (api , rscName , disk .getDispName (), disk .getVmName ());
528525 } catch (ApiException apiExc ) {
529- s_logger .error (String . format ( "Error setting aux properties for %s " , rscName ) );
526+ logger .error ("Error setting aux properties for {} " , rscName );
530527 logLinstorAnswers (apiExc .getApiCallRcList ());
531528 }
532529
533- logger .debug (String . format ( "Linstor.copyPhysicalDisk: dstPath: %s " , dstDisk .getPath () ));
530+ logger .debug ("Linstor.copyPhysicalDisk: dstPath: {} " , dstDisk .getPath ());
534531 final QemuImgFile destFile = new QemuImgFile (dstDisk .getPath ());
535532 destFile .setFormat (dstDisk .getFormat ());
536533 destFile .setSize (disk .getVirtualSize ());
0 commit comments