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 ;
@@ -786,6 +786,7 @@ private void expunge(final Completion completion) {
786786 }
787787
788788 final VolumeInventory inv = getSelfInventory ();
789+ String accountUuid = self .getAccountUuid ();
789790 pluginRgty .getExtensionList (VolumeBeforeExpungeExtensionPoint .class ).forEach (ext -> ext .volumePreExpunge (inv ));
790791 FlowChain chain = FlowChainBuilder .newShareFlowChain ();
791792 chain .setName ("expunge-volume" );
@@ -873,7 +874,6 @@ public void handle(Map data) {
873874 CollectionUtils .safeForEach (pluginRgty .getExtensionList (VolumeAfterExpungeExtensionPoint .class ), arg -> arg .volumeAfterExpunge (inv ));
874875
875876 VolumeInventory volumeInventory = getSelfInventory ();
876- String accountUuid = acntMgr .getOwnerAccountUuidOfResource (self .getUuid ());
877877 dbf .remove (self );
878878 cleanupVolumeEO (self .getUuid ());
879879 completion .success ();
@@ -1205,12 +1205,12 @@ public void rollback(FlowRollback trigger, Map data) {
12051205 @ Override
12061206 public void handle (Map data ) {
12071207 VolumeStatus oldStatus = self .getStatus ();
1208+ String accountUuid = self .getAccountUuid ();
12081209
12091210 if (deletionPolicy == VolumeDeletionPolicy .Direct ) {
12101211 callVmJustBeforeDeleteFromDbExtensionPoint ();
12111212 self .setStatus (VolumeStatus .Deleted );
12121213 self = dbf .updateAndRefresh (self );
1213- String accountUuid = acntMgr .getOwnerAccountUuidOfResource (self .getUuid ());
12141214 VolumeInventory volumeInventory = getSelfInventory ();
12151215 dbf .remove (self );
12161216 cleanupVolumeEO (self .getUuid ());
@@ -1227,7 +1227,6 @@ public void handle(Map data) {
12271227 callVmJustBeforeDeleteFromDbExtensionPoint ();
12281228 VolumeInventory inventory = getSelfInventory ();
12291229 inventory .setStatus (VolumeStatus .Deleted .toString ());
1230- String accountUuid = acntMgr .getOwnerAccountUuidOfResource (self .getUuid ());
12311230 dbf .remove (self );
12321231 new FireVolumeCanonicalEvent ().fireVolumeStatusChangedEvent (oldStatus , inventory , accountUuid );
12331232 } else {
@@ -1419,7 +1418,7 @@ public void run(final SyncTaskChain chain) {
14191418 if (deletionPolicy == VolumeDeletionPolicy .DBOnly ) {
14201419 callVmJustBeforeDeleteFromDbExtensionPoint ();
14211420 VolumeInventory inventory = getSelfInventory ();
1422- String accountUuid = acntMgr . getOwnerAccountUuidOfResource ( self .getUuid () );
1421+ String accountUuid = self .getAccountUuid ( );
14231422 dbf .remove (self );
14241423 new FireVolumeCanonicalEvent ().fireVolumeStatusChangedEvent (self .getStatus (), inventory , accountUuid );
14251424 }
0 commit comments