Skip to content

Commit 5347a15

Browse files
committed
revert exception change
1 parent cac5905 commit 5347a15

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3984,7 +3984,7 @@ private NetworkVO getDefaultNetwork(DataCenter zone, Account owner, boolean sele
39843984
return defaultNetwork;
39853985
}
39863986

3987-
protected NetworkVO createDefaultNetworkForAccount(DataCenter zone, Account owner, List<NetworkOfferingVO> requiredOfferings)
3987+
private NetworkVO createDefaultNetworkForAccount(DataCenter zone, Account owner, List<NetworkOfferingVO> requiredOfferings)
39883988
throws InsufficientCapacityException, ResourceAllocationException {
39893989
NetworkVO defaultNetwork = null;
39903990
long physicalNetworkId = _networkModel.findPhysicalNetworkId(zone.getId(), requiredOfferings.get(0).getTags(), requiredOfferings.get(0).getTrafficType());
@@ -7594,7 +7594,7 @@ protected void executeStepsToChangeOwnershipOfVm(AssignVMCmd cmd, Account caller
75947594
MutableBoolean isNetworkCreated = new MutableBoolean(false);
75957595
try {
75967596
updateVmNetwork(cmd, caller, vm, newAccount, template, isNetworkCreated);
7597-
} catch (Exception e) {
7597+
} catch (InsufficientCapacityException | ResourceAllocationException e) {
75987598
List<NetworkVO> networkVOS = _networkDao.listByAccountIdNetworkName(newAccountId, newAccount.getAccountName() + "-network");
75997599
if (networkVOS.size() == 1 && isNetworkCreated.get()) {
76007600
_networkDao.remove(networkVOS.get(0).getId());
@@ -7663,7 +7663,7 @@ protected void updateVolumesOwner(final List<VolumeVO> volumes, Account oldAccou
76637663
* @throws ResourceAllocationException
76647664
*/
76657665
protected void updateVmNetwork(AssignVMCmd cmd, Account caller, UserVmVO vm, Account newAccount, VirtualMachineTemplate template, MutableBoolean isNetworkCreated)
7666-
throws Exception {
7666+
throws InsufficientCapacityException, ResourceAllocationException {
76677667

76687668
logger.trace("Updating network for VM [{}].", vm);
76697669

@@ -7792,7 +7792,7 @@ protected void updateBasicTypeNetworkForVm(AssignVMCmd cmd, UserVmVO vm, Account
77927792
*/
77937793
protected void updateAdvancedTypeNetworkForVm(AssignVMCmd cmd, Account caller, UserVmVO vm, Account newAccount, VirtualMachineTemplate template,
77947794
VirtualMachineProfileImpl vmOldProfile, DataCenterVO zone, List<Long> networkIdList, List<Long> securityGroupIdList, MutableBoolean isNetworkCreated)
7795-
throws Exception {
7795+
throws InsufficientCapacityException, ResourceAllocationException, InvalidParameterValueException {
77967796

77977797
LinkedHashSet<NetworkVO> applicableNetworks = new LinkedHashSet<>();
77987798
Map<Long, String> requestedIPv4ForNics = new HashMap<>();
@@ -7947,7 +7947,7 @@ protected NetworkVO addNicsToApplicableNetworksAndReturnDefaultNetwork(LinkedHas
79477947
*/
79487948
protected void selectApplicableNetworkToCreateVm(Account caller, Account newAccount, DataCenterVO zone,
79497949
Set<NetworkVO> applicableNetworks, MutableBoolean isNetworkCreated)
7950-
throws Exception {
7950+
throws InsufficientCapacityException, ResourceAllocationException {
79517951

79527952
logger.trace("Selecting the applicable network to create the VM.");
79537953

0 commit comments

Comments
 (0)