Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@
import com.cloud.resourcelimit.CheckedReservation;
import com.cloud.storage.VMTemplateVO;
import com.cloud.storage.VolumeVO;
import com.cloud.storage.SnapshotVO;
import com.cloud.storage.dao.VMTemplateDao;
import com.cloud.storage.dao.VolumeDao;
import com.cloud.storage.dao.SnapshotDao;
import com.cloud.user.Account;
import com.cloud.user.AccountManager;
import com.cloud.user.ResourceLimitService;
Expand Down Expand Up @@ -163,6 +165,8 @@ protected void runInContext() {
@Inject
ReservationDao _reservationDao;

@Inject
private SnapshotDao _snapshotDao;
private LazyCache<Long, List<Hypervisor.HypervisorType>> zoneHypervisorsCache;

private List<Hypervisor.HypervisorType> listAvailHypervisorInZone(long zoneId) {
Expand Down Expand Up @@ -275,7 +279,9 @@ private Long getAccountIdForDataObject() {
} else if (DataObjectType.VOLUME.equals(object.getType())) {
VolumeVO v = _volumeDao.findById(object.getId());
return v != null ? v.getAccountId() : null;
}
} else if (DataObjectType.SNAPSHOT.equals(object.getType())) {
SnapshotVO s = _snapshotDao.findById(object.getId());
return s != null ? s.getAccountId() : null;
Comment on lines +282 to +284

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} else if (DataObjectType.SNAPSHOT.equals(object.getType())) {
SnapshotVO s = _snapshotDao.findById(object.getId());
return s != null ? s.getAccountId() : null;
} else if (DataObjectType.SNAPSHOT.equals(object.getType())) {
SnapshotVO s = _snapshotDao.findById(object.getId());
return s != null ? s.getAccountId() : null;
}

return null;
}

Expand Down
Loading