This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a commit to branch fix-assign-vm-1
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/fix-assign-vm-1 by this push:
     new 5347a15e016 revert exception change
5347a15e016 is described below

commit 5347a15e0165a2f6d9ef1729eea2b3d61885f011
Author: Pearl Dsilva <[email protected]>
AuthorDate: Fri May 9 20:24:42 2025 +0530

    revert exception change
---
 server/src/main/java/com/cloud/vm/UserVmManagerImpl.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java 
b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
index 61d127e55aa..cf0e0920326 100644
--- a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
@@ -3984,7 +3984,7 @@ public class UserVmManagerImpl extends ManagerBase 
implements UserVmManager, Vir
         return defaultNetwork;
     }
 
-    protected NetworkVO createDefaultNetworkForAccount(DataCenter zone, 
Account owner, List<NetworkOfferingVO> requiredOfferings)
+    private NetworkVO createDefaultNetworkForAccount(DataCenter zone, Account 
owner, List<NetworkOfferingVO> requiredOfferings)
             throws InsufficientCapacityException, ResourceAllocationException {
         NetworkVO defaultNetwork = null;
         long physicalNetworkId = 
_networkModel.findPhysicalNetworkId(zone.getId(), 
requiredOfferings.get(0).getTags(), requiredOfferings.get(0).getTrafficType());
@@ -7594,7 +7594,7 @@ public class UserVmManagerImpl extends ManagerBase 
implements UserVmManager, Vir
         MutableBoolean isNetworkCreated = new MutableBoolean(false);
         try {
             updateVmNetwork(cmd, caller, vm, newAccount, template, 
isNetworkCreated);
-        } catch (Exception e) {
+        } catch (InsufficientCapacityException | ResourceAllocationException 
e) {
             List<NetworkVO> networkVOS = 
_networkDao.listByAccountIdNetworkName(newAccountId, 
newAccount.getAccountName() + "-network");
             if (networkVOS.size() == 1 && isNetworkCreated.get()) {
                 _networkDao.remove(networkVOS.get(0).getId());
@@ -7663,7 +7663,7 @@ public class UserVmManagerImpl extends ManagerBase 
implements UserVmManager, Vir
      * @throws ResourceAllocationException
      */
     protected void updateVmNetwork(AssignVMCmd cmd, Account caller, UserVmVO 
vm, Account newAccount, VirtualMachineTemplate template, MutableBoolean 
isNetworkCreated)
-            throws Exception {
+            throws InsufficientCapacityException, ResourceAllocationException {
 
         logger.trace("Updating network for VM [{}].", vm);
 
@@ -7792,7 +7792,7 @@ public class UserVmManagerImpl extends ManagerBase 
implements UserVmManager, Vir
      */
     protected void updateAdvancedTypeNetworkForVm(AssignVMCmd cmd, Account 
caller, UserVmVO vm, Account newAccount, VirtualMachineTemplate template,
                                                   VirtualMachineProfileImpl 
vmOldProfile, DataCenterVO zone, List<Long> networkIdList, List<Long> 
securityGroupIdList, MutableBoolean isNetworkCreated)
-            throws Exception {
+            throws InsufficientCapacityException, ResourceAllocationException, 
InvalidParameterValueException {
 
         LinkedHashSet<NetworkVO> applicableNetworks = new LinkedHashSet<>();
         Map<Long, String> requestedIPv4ForNics = new HashMap<>();
@@ -7947,7 +7947,7 @@ public class UserVmManagerImpl extends ManagerBase 
implements UserVmManager, Vir
      */
     protected void selectApplicableNetworkToCreateVm(Account caller, Account 
newAccount, DataCenterVO zone,
                                                         Set<NetworkVO> 
applicableNetworks, MutableBoolean isNetworkCreated)
-            throws Exception {
+            throws InsufficientCapacityException, ResourceAllocationException {
 
         logger.trace("Selecting the applicable network to create the VM.");
 

Reply via email to