@@ -1270,7 +1270,7 @@ private CopyVolumeAnswer execute(CopyVolumeCommand cmd) {
12701270 secondaryStoragePool = _storagePoolMgr .getStoragePoolByURI (
12711271 secondaryStorageUrl );
12721272 secondaryStoragePool .createFolder (volumeDestPath );
1273- secondaryStoragePool .delete ( );
1273+ _storagePoolMgr . deleteStoragePool ( secondaryStoragePool .getType (), secondaryStoragePool . getUuid () );
12741274 secondaryStoragePool = _storagePoolMgr .getStoragePoolByURI (
12751275 secondaryStorageUrl
12761276 + volumeDestPath );
@@ -1292,7 +1292,7 @@ private CopyVolumeAnswer execute(CopyVolumeCommand cmd) {
12921292 return new CopyVolumeAnswer (cmd , false , e .toString (), null , null );
12931293 } finally {
12941294 if (secondaryStoragePool != null ) {
1295- secondaryStoragePool .delete ( );
1295+ _storagePoolMgr . deleteStoragePool ( secondaryStoragePool .getType (), secondaryStoragePool . getUuid () );
12961296 }
12971297 }
12981298 }
@@ -1415,7 +1415,7 @@ protected KVMPhysicalDisk templateToPrimaryDownload(String templateUrl, KVMStora
14151415 return null ;
14161416 } finally {
14171417 if (secondaryPool != null ) {
1418- secondaryPool .delete ( );
1418+ _storagePoolMgr . deleteStoragePool ( secondaryPool .getType (), secondaryPool . getUuid () );
14191419 }
14201420 }
14211421 }
@@ -2008,7 +2008,7 @@ protected BackupSnapshotAnswer execute(final BackupSnapshotCommand cmd) {
20082008 true );
20092009 } finally {
20102010 if (secondaryStoragePool != null ) {
2011- secondaryStoragePool .delete ( );
2011+ _storagePoolMgr . deleteStoragePool ( secondaryStoragePool .getType (), secondaryStoragePool . getUuid () );
20122012 }
20132013 }
20142014 return new BackupSnapshotAnswer (cmd , true , null , snapshotRelPath
@@ -2040,7 +2040,7 @@ protected DeleteSnapshotBackupAnswer execute(
20402040 return new DeleteSnapshotBackupAnswer (cmd , false , e .toString ());
20412041 } finally {
20422042 if (secondaryStoragePool != null ) {
2043- secondaryStoragePool .delete ( );
2043+ _storagePoolMgr . deleteStoragePool ( secondaryStoragePool .getType (), secondaryStoragePool . getUuid () );
20442044 }
20452045 }
20462046 return new DeleteSnapshotBackupAnswer (cmd , true , null );
@@ -2069,7 +2069,7 @@ protected Answer execute(DeleteSnapshotsDirCommand cmd) {
20692069 return new Answer (cmd , false , e .toString ());
20702070 } finally {
20712071 if (secondaryStoragePool != null ) {
2072- secondaryStoragePool .delete ( );
2072+ _storagePoolMgr . deleteStoragePool ( secondaryStoragePool .getType (), secondaryStoragePool . getUuid () );
20732073 }
20742074
20752075 }
@@ -2167,10 +2167,10 @@ protected CreatePrivateTemplateAnswer execute(
21672167 return new CreatePrivateTemplateAnswer (cmd , false , e .getMessage ());
21682168 } finally {
21692169 if (secondaryPool != null ) {
2170- secondaryPool .delete ( );
2170+ _storagePoolMgr . deleteStoragePool ( secondaryPool .getType (), secondaryPool . getUuid () );
21712171 }
21722172 if (snapshotPool != null ) {
2173- snapshotPool .delete ( );
2173+ _storagePoolMgr . deleteStoragePool ( snapshotPool .getType (), snapshotPool . getUuid () );
21742174 }
21752175 }
21762176 }
@@ -2304,7 +2304,7 @@ protected CreatePrivateTemplateAnswer execute(
23042304 return new CreatePrivateTemplateAnswer (cmd , false , e .toString ());
23052305 } finally {
23062306 if (secondaryStorage != null ) {
2307- secondaryStorage .delete ( );
2307+ _storagePoolMgr . deleteStoragePool ( secondaryStorage .getType (), secondaryStorage . getUuid () );
23082308 }
23092309 }
23102310 }
@@ -2362,7 +2362,7 @@ protected PrimaryStorageDownloadAnswer execute(
23622362 return new PrimaryStorageDownloadAnswer (e .toString ());
23632363 } finally {
23642364 if (secondaryPool != null ) {
2365- secondaryPool .delete ( );
2365+ _storagePoolMgr . deleteStoragePool ( secondaryPool .getType (), secondaryPool . getUuid () );
23662366 }
23672367 }
23682368 }
@@ -3454,7 +3454,7 @@ private boolean cleanupDisk(Connect conn, DiskDef disk) {
34543454 KVMStoragePool pool = _storagePoolMgr .getStoragePool (
34553455 StoragePoolType .Filesystem , poolUuid );
34563456 if (pool != null ) {
3457- pool .delete ( );
3457+ _storagePoolMgr . deleteStoragePool ( pool .getType (), pool . getUuid () );
34583458 }
34593459 return true ;
34603460 } catch (CloudRuntimeException e ) {
0 commit comments