You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by su...@apache.org on 2021/12/01 05:37:26 UTC

[cloudstack] 01/01: Revert "Fix NPE on scale VM operation after the corresponding template is deleted (#5721)"

This is an automated email from the ASF dual-hosted git repository.

sureshanaparti pushed a commit to branch revert-5721-FixScaleVMNPE
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 24726864ecc36f0c17686a1d29b7b1c38bd0788d
Author: sureshanaparti <12...@users.noreply.github.com>
AuthorDate: Wed Dec 1 11:06:40 2021 +0530

    Revert "Fix NPE on scale VM operation after the corresponding template is deleted (#5721)"
    
    This reverts commit 895f282d9a122bec83a210df53e30c3e5a86201d.
---
 .../src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java           | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
index 31bc051..0c8736b 100755
--- a/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -3808,7 +3808,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
         if (currentServiceOffering.isDynamic() && !newServiceOffering.isDynamic()) {
             removeCustomOfferingDetails(vmId);
         }
-        VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vmForUpdate.getTemplateId());
+        VMTemplateVO template = _templateDao.findById(vmForUpdate.getTemplateId());
         boolean dynamicScalingEnabled = _userVmMgr.checkIfDynamicScalingCanBeEnabled(vmForUpdate, newServiceOffering, template, vmForUpdate.getDataCenterId());
         vmForUpdate.setDynamicallyScalable(dynamicScalingEnabled);
         return _vmDao.update(vmId, vmForUpdate);