2727
2828import javax .inject .Inject ;
2929
30- import org .apache .log4j .Logger ;
31-
3230import org .apache .cloudstack .engine .subsystem .api .storage .ClusterScope ;
3331import org .apache .cloudstack .engine .subsystem .api .storage .DataStore ;
3432import org .apache .cloudstack .engine .subsystem .api .storage .DataStoreManager ;
4038import org .apache .cloudstack .storage .datastore .db .PrimaryDataStoreDao ;
4139import org .apache .cloudstack .storage .datastore .db .StoragePoolVO ;
4240import org .apache .cloudstack .storage .volume .datastore .PrimaryDataStoreHelper ;
41+ import org .apache .log4j .Logger ;
4342
4443import com .cloud .agent .AgentManager ;
4544import com .cloud .agent .api .Answer ;
@@ -250,7 +249,7 @@ public DataStore initialize(Map<String, Object> dsInfos) {
250249 if (clusterId == null ) {
251250 throw new IllegalArgumentException ("IscsiLUN need to have clusters specified" );
252251 }
253- hostPath .replaceFirst ("/" , "" );
252+ hostPath = hostPath .replaceFirst ("/" , "" );
254253 parameters .setType (StoragePoolType .IscsiLUN );
255254 parameters .setHost (storageHost );
256255 parameters .setPort (port );
@@ -321,7 +320,7 @@ public DataStore initialize(Map<String, Object> dsInfos) {
321320 } else if (scheme .equalsIgnoreCase ("PreSetup" )) {
322321 uuid = hostPath .replace ("/" , "" );
323322 } else {
324- uuid = UUID .nameUUIDFromBytes (new String (storageHost + hostPath ).getBytes ()).toString ();
323+ uuid = UUID .nameUUIDFromBytes ((storageHost + hostPath ).getBytes ()).toString ();
325324 }
326325
327326 List <StoragePoolVO > spHandles = primaryDataStoreDao .findIfDuplicatePoolsExistByUUID (uuid );
@@ -348,9 +347,9 @@ protected boolean createStoragePool(long hostId, StoragePool pool) {
348347 s_logger .debug ("creating pool " + pool .getName () + " on host " + hostId );
349348
350349 if (pool .getPoolType () != StoragePoolType .NetworkFilesystem && pool .getPoolType () != StoragePoolType .Filesystem &&
351- pool .getPoolType () != StoragePoolType .IscsiLUN && pool .getPoolType () != StoragePoolType .Iscsi && pool .getPoolType () != StoragePoolType .VMFS &&
352- pool .getPoolType () != StoragePoolType .SharedMountPoint && pool .getPoolType () != StoragePoolType .PreSetup && pool .getPoolType () != StoragePoolType .OCFS2 &&
353- pool .getPoolType () != StoragePoolType .RBD && pool .getPoolType () != StoragePoolType .CLVM && pool .getPoolType () != StoragePoolType .SMB ) {
350+ pool .getPoolType () != StoragePoolType .IscsiLUN && pool .getPoolType () != StoragePoolType .Iscsi && pool .getPoolType () != StoragePoolType .VMFS &&
351+ pool .getPoolType () != StoragePoolType .SharedMountPoint && pool .getPoolType () != StoragePoolType .PreSetup && pool .getPoolType () != StoragePoolType .OCFS2 &&
352+ pool .getPoolType () != StoragePoolType .RBD && pool .getPoolType () != StoragePoolType .CLVM && pool .getPoolType () != StoragePoolType .SMB ) {
354353 s_logger .warn (" Doesn't support storage pool type " + pool .getPoolType ());
355354 return false ;
356355 }
@@ -377,7 +376,7 @@ public boolean attachCluster(DataStore store, ClusterScope scope) {
377376 PrimaryDataStoreInfo primarystore = (PrimaryDataStoreInfo )store ;
378377 // Check if there is host up in this cluster
379378 List <HostVO > allHosts =
380- _resourceMgr .listAllUpAndEnabledHosts (Host .Type .Routing , primarystore .getClusterId (), primarystore .getPodId (), primarystore .getDataCenterId ());
379+ _resourceMgr .listAllUpAndEnabledHosts (Host .Type .Routing , primarystore .getClusterId (), primarystore .getPodId (), primarystore .getDataCenterId ());
381380 if (allHosts .isEmpty ()) {
382381 primaryDataStoreDao .expunge (primarystore .getId ());
383382 throw new CloudRuntimeException ("No host up to associate a storage pool with in cluster " + primarystore .getClusterId ());
0 commit comments