rafaelweingartner commented on a change in pull request #2298: CLOUDSTACK-9620:
Enhancements for managed storage
URL: https://github.com/apache/cloudstack/pull/2298#discussion_r161306727
##########
File path: engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -599,6 +607,60 @@ protected void advanceExpunge(VMInstanceVO vm) throws
ResourceUnavailableExcepti
}
+ private List<Map<String, String>> getTargets(Long hostId, long vmId) {
+ List<Map<String, String>> targets = new ArrayList<>();
+
+ HostVO hostVO = _hostDao.findById(hostId);
+
+ if (hostVO != null && hostVO.getHypervisorType() ==
HypervisorType.VMware) {
+ List<VolumeVO> volumes = _volsDao.findByInstance(vmId);
+
+ if (volumes != null) {
Review comment:
Got it. I have seen reviewers also saying that. I personally disagree....
specially in method where we might have few conditionals, and by doing this
check and return, we can avoid nesting them.
Thanks for your work!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services