3333import org .zstack .header .image .ImageInventory ;
3434import org .zstack .header .image .ImagePlatform ;
3535import org .zstack .header .image .ImageVO ;
36- import org .zstack .header .message .*;
3736import org .zstack .header .message .APIDeleteMessage .DeletionMode ;
37+ import org .zstack .header .message .*;
3838import org .zstack .header .storage .primary .*;
3939import org .zstack .header .storage .snapshot .*;
4040import org .zstack .header .storage .snapshot .group .MemorySnapshotGroupExtensionPoint ;
@@ -784,6 +784,7 @@ private void expunge(final Completion completion) {
784784 }
785785
786786 final VolumeInventory inv = getSelfInventory ();
787+ String accountUuid = self .getAccountUuid ();
787788 pluginRgty .getExtensionList (VolumeBeforeExpungeExtensionPoint .class ).forEach (ext -> ext .volumePreExpunge (inv ));
788789 FlowChain chain = FlowChainBuilder .newShareFlowChain ();
789790 chain .setName ("expunge-volume" );
@@ -871,7 +872,6 @@ public void handle(Map data) {
871872 CollectionUtils .safeForEach (pluginRgty .getExtensionList (VolumeAfterExpungeExtensionPoint .class ), arg -> arg .volumeAfterExpunge (inv ));
872873
873874 VolumeInventory volumeInventory = getSelfInventory ();
874- String accountUuid = acntMgr .getOwnerAccountUuidOfResource (self .getUuid ());
875875 dbf .remove (self );
876876 cleanupVolumeEO (self .getUuid ());
877877 completion .success ();
@@ -1203,12 +1203,12 @@ public void rollback(FlowRollback trigger, Map data) {
12031203 @ Override
12041204 public void handle (Map data ) {
12051205 VolumeStatus oldStatus = self .getStatus ();
1206+ String accountUuid = self .getAccountUuid ();
12061207
12071208 if (deletionPolicy == VolumeDeletionPolicy .Direct ) {
12081209 callVmJustBeforeDeleteFromDbExtensionPoint ();
12091210 self .setStatus (VolumeStatus .Deleted );
12101211 self = dbf .updateAndRefresh (self );
1211- String accountUuid = acntMgr .getOwnerAccountUuidOfResource (self .getUuid ());
12121212 VolumeInventory volumeInventory = getSelfInventory ();
12131213 dbf .remove (self );
12141214 cleanupVolumeEO (self .getUuid ());
@@ -1225,7 +1225,6 @@ public void handle(Map data) {
12251225 callVmJustBeforeDeleteFromDbExtensionPoint ();
12261226 VolumeInventory inventory = getSelfInventory ();
12271227 inventory .setStatus (VolumeStatus .Deleted .toString ());
1228- String accountUuid = acntMgr .getOwnerAccountUuidOfResource (self .getUuid ());
12291228 dbf .remove (self );
12301229 new FireVolumeCanonicalEvent ().fireVolumeStatusChangedEvent (oldStatus , inventory , accountUuid );
12311230 } else {
@@ -1417,7 +1416,7 @@ public void run(final SyncTaskChain chain) {
14171416 if (deletionPolicy == VolumeDeletionPolicy .DBOnly ) {
14181417 callVmJustBeforeDeleteFromDbExtensionPoint ();
14191418 VolumeInventory inventory = getSelfInventory ();
1420- String accountUuid = acntMgr . getOwnerAccountUuidOfResource ( self .getUuid () );
1419+ String accountUuid = self .getAccountUuid ( );
14211420 dbf .remove (self );
14221421 new FireVolumeCanonicalEvent ().fireVolumeStatusChangedEvent (self .getStatus (), inventory , accountUuid );
14231422 }
0 commit comments