DaanHoogland commented on code in PR #8302:
URL: https://github.com/apache/cloudstack/pull/8302#discussion_r1423783829
##########
engine/schema/src/main/java/com/cloud/storage/dao/VolumeDaoImpl.java:
##########
@@ -811,4 +820,16 @@ public List<VolumeVO> listByIds(List<Long> ids) {
sc.setParameters("idIN", ids.toArray());
return listBy(sc, null);
}
+
+ @Override
+ public VolumeVO persist(VolumeVO entity) {
+ Object obj =
CallContext.current().getContextParameter(String.format("%s-%s",
ResourceReservation.class.getSimpleName(),
Resource.ResourceType.volume.getName()));
+ if (obj instanceof Long) {
+ long reservationId = (long) obj;
+ if (reservationDao.findById(reservationId) != null) {
+ entity.setResourceReservationId((long) obj);
+ }
Review Comment:
so what if we have a reservation id but it does not exist in the DB? (unit
test worthy?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]