Updated Branches:
  refs/heads/4.2 a250fca4b -> 7c664728f

CLOUDSTACK-3634: Adding router.template.xen/kvm/hyperv/kvm/lxc in upgrade setup

Signed-off-by: Jayapal <[email protected]>


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

Branch: refs/heads/4.2
Commit: 7c664728f7d9d82c32fae09f62f98d77b74634b5
Parents: a250fca
Author: Harikrishna Patnala <[email protected]>
Authored: Fri Jul 19 14:08:38 2013 +0530
Committer: Jayapal <[email protected]>
Committed: Fri Jul 19 14:29:50 2013 +0530

----------------------------------------------------------------------
 .../schema/src/com/cloud/upgrade/dao/Upgrade410to420.java | 10 ++++++----
 setup/db/db/schema-410to420.sql                           |  6 ++++++
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7c664728/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java 
b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
index e54a699..4c4faf7 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java
@@ -36,6 +36,8 @@ import java.util.List;
 import java.util.UUID;
 import java.util.Set;
 import java.util.HashSet;
+import java.util.Map;
+import java.util.HashMap;
 import com.cloud.network.vpc.NetworkACL;
 
 public class Upgrade410to420 implements DbUpgrade {
@@ -245,10 +247,10 @@ public class Upgrade410to420 implements DbUpgrade {
                         pstmt.executeUpdate();
                         pstmt.close();
                         // Change value of global configuration parameter 
router.template.* for the corresponding hypervisor
-                        pstmt = conn.prepareStatement("INSERT IGNORE INTO 
`cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'NetworkManager', ?, ?, 
'Name of the default router template on Xenserver')");
-                        pstmt.setString(1, 
routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()));
-                        pstmt.setString(2, 
hypervisorAndTemplateName.getValue());
-                        pstmt.execute();
+                        pstmt = conn.prepareStatement("UPDATE 
`cloud`.`configuration` SET value = ? WHERE name = ?");
+                        pstmt.setString(1, 
hypervisorAndTemplateName.getValue());
+                        pstmt.setString(2, 
routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey()));
+                        pstmt.executeUpdate();
                         pstmt.close();
                     } else {
                         if 
(hypervisorsListInUse.contains(hypervisorAndTemplateName.getKey())){

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7c664728/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 921d5fa..c64e330 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -2177,6 +2177,12 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES 
('Advanced', 'DEFAULT', 'manag
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 
'management-server', 'interval.baremetal.securitygroup.agent.echo', 10, 
'Interval to echo baremetal security group agent, in seconds');
 INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 
'management-server', 'timeout.baremetal.securitygroup.agent.echo', 3600, 
'Timeout to echo baremetal security group agent, in seconds, the provisioning 
process will be treated as a failure');
 
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 
'NetworkManager', 'router.template.hyperv', 'SystemVM Template (HyperV)', 'Name 
of the default router template on Hyperv.');
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 
'NetworkManager', 'router.template.kvm', 'SystemVM Template (KVM)', 'Name of 
the default router template on KVM.');
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 
'NetworkManager', 'router.template.lxc', 'SystemVM Template (LXC)', 'Name of 
the default router template on LXC.');
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 
'NetworkManager', 'router.template.vmware', 'SystemVM Template (vSphere)', 
'Name of the default router template on Vmware.');
+INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 
'NetworkManager', 'router.template.xen', 'SystemVM Template (XenServer)', 'Name 
of the default router template on Xenserver.');
+
 alter table `cloud`.`network_offerings` add column egress_default_policy 
boolean default false;
 
 -- Add stratospher ssp tables

Reply via email to