You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2020/10/15 17:55:15 UTC

[cloudstack] branch 4.14 updated: server: fix issue that vm guest os type is reset after updatetemplate (#4377)

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

dahn pushed a commit to branch 4.14
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.14 by this push:
     new f7a3701  server: fix issue that vm guest os type is reset after updatetemplate (#4377)
f7a3701 is described below

commit f7a3701c7a2fc49ccd2105e600b01cb985fb8127
Author: Wei Zhou <w....@global.leaseweb.com>
AuthorDate: Thu Oct 15 19:54:59 2020 +0200

    server: fix issue that vm guest os type is reset after updatetemplate (#4377)
---
 server/src/main/java/com/cloud/template/TemplateManagerImpl.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/src/main/java/com/cloud/template/TemplateManagerImpl.java b/server/src/main/java/com/cloud/template/TemplateManagerImpl.java
index 749f272..a651cff 100755
--- a/server/src/main/java/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/main/java/com/cloud/template/TemplateManagerImpl.java
@@ -2063,6 +2063,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
             ex.addProxyObject(String.valueOf(id), "templateId");
             throw ex;
         }
+        long oldGuestOSId = template.getGuestOSId();
 
         verifyTemplateId(id);
 
@@ -2119,7 +2120,6 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
         }
 
         if (guestOSId != null) {
-            long oldGuestOSId = template.getGuestOSId();
             GuestOSVO guestOS = _guestOSDao.findById(guestOSId);
 
             if (guestOS == null) {