cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [05/20] git commit: updated refs/heads/4.3 to 67df5b9
Date Tue, 25 Nov 2014 19:05:01 GMT
CLOUDSTACK-6869: SSH Public key content is overridden by template's meta data when you create
a instance

(cherry picked from commit 522208dec2f81997c8b14d820c4f3f1be958ee44)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	server/src/com/cloud/template/TemplateManagerImpl.java
	server/src/com/cloud/vm/UserVmManagerImpl.java


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/8992e188
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8992e188
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8992e188

Branch: refs/heads/4.3
Commit: 8992e1883647aea65a22f69d7f514d0a7fab389b
Parents: bad40a7
Author: Harikrishna Patnala <harikrishna.patnala@citrix.com>
Authored: Wed Jun 11 16:33:00 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Tue Nov 25 22:50:03 2014 +0530

----------------------------------------------------------------------
 server/src/com/cloud/template/TemplateManagerImpl.java |  3 ++-
 server/src/com/cloud/vm/UserVmManagerImpl.java         | 11 ++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8992e188/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index 7727061..3dd91f4 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -1700,7 +1700,8 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
                     }
                 }
             }
-            if(cmd.getDetails() != null) {
+            if (cmd.getDetails() != null) {
+                details.remove("Encrypted.Password"); // new password will be generated during
vm deployment from password enabled template
                 details.putAll(cmd.getDetails());
             }
             if( !details.isEmpty()) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8992e188/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index a40af6e..e6390a0 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2989,6 +2989,12 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
                         hostName, diskOfferingId);
                 vm.setUuid(uuidName);
                 vm.setDynamicallyScalable(template.isDynamicallyScalable());
+
+                Map<String, String> details = template.getDetails();
+                if (details != null && !details.isEmpty()) {
+                    vm.details.putAll(details);
+                }
+
                 if (sshPublicKey != null) {
                     vm.setDetail("SSH.PublicKey", sshPublicKey);
                 }
@@ -3038,11 +3044,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
                     }
                 }
 
-                Map<String, String> details = template.getDetails();
-                if ( details != null && !details.isEmpty() ) {
-                    vm.details.putAll(details);
-                }
-
                 _vmDao.persist(vm);
                 if (customParameters != null && customParameters.size() > 0) {
                     for (String key : customParameters.keySet()) {


Mime
View raw message