Skip to content

Commit d5064fe

Browse files
committed
Replace for loop with call to ReservationHelper
1 parent afcbf2f commit d5064fe

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4635,14 +4635,7 @@ private UserVm getUncheckedUserVmResource(DataCenter zone, String hostName, Stri
46354635
logger.error("error during resource reservation and allocation", e);
46364636
throw new CloudRuntimeException(e);
46374637
} finally {
4638-
for (CheckedReservation checkedReservation : checkedReservations) {
4639-
try {
4640-
checkedReservation.close();
4641-
} catch (Exception e) {
4642-
logger.error("error during resource reservation and allocation", e);
4643-
throw new CloudRuntimeException(e);
4644-
}
4645-
}
4638+
ReservationHelper.closeAll(checkedReservations);
46464639
}
46474640
}
46484641

0 commit comments

Comments
 (0)