CLOUDSTACK-1804:Upgrade 4.0 -> 4.1 - DB upgrade fails. remove the data migration functions that were accidently introduced by commit b6727e564654da2604e17ca477e21d03d4afeb05
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/f414b8a8 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/f414b8a8 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/f414b8a8 Branch: refs/heads/internalLb Commit: f414b8a850607d20c0a78d455b4c43d90947b41f Parents: c5fb834 Author: Murali Reddy <murali.re...@citrix.com> Authored: Wed Mar 27 18:06:22 2013 +0530 Committer: Murali Reddy <murali.re...@citrix.com> Committed: Wed Mar 27 18:06:22 2013 +0530 ---------------------------------------------------------------------- .../src/com/cloud/upgrade/dao/Upgrade40to41.java | 40 +-------------- 1 files changed, 1 insertions(+), 39 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f414b8a8/server/src/com/cloud/upgrade/dao/Upgrade40to41.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/upgrade/dao/Upgrade40to41.java b/server/src/com/cloud/upgrade/dao/Upgrade40to41.java index 4a2fe4f..9e386b9 100644 --- a/server/src/com/cloud/upgrade/dao/Upgrade40to41.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade40to41.java @@ -20,19 +20,15 @@ package com.cloud.upgrade.dao; import com.cloud.utils.db.Transaction; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.script.Script; +import org.apache.log4j.Logger; import java.io.File; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; import java.util.UUID; -import org.apache.log4j.Logger; - public class Upgrade40to41 implements DbUpgrade { final static Logger s_logger = Logger.getLogger(Upgrade40to41.class); @@ -64,7 +60,6 @@ public class Upgrade40to41 implements DbUpgrade { @Override public void performDataMigration(Connection conn) { updateRegionEntries(conn); - upgradeEIPNetworkOfferings(conn); upgradeEgressFirewallRules(conn); } @@ -100,39 +95,6 @@ public class Upgrade40to41 implements DbUpgrade { } } - private void upgradeEIPNetworkOfferings(Connection conn) { - PreparedStatement pstmt = null; - ResultSet rs = null; - - try { - pstmt = conn.prepareStatement("select id, elastic_ip_service from `cloud`.`network_offerings` where traffic_type='Guest'"); - rs = pstmt.executeQuery(); - while (rs.next()) { - long id = rs.getLong(1); - // check if elastic IP service is enabled for network offering - if (rs.getLong(2) != 0) { - //update network offering with eip_associate_public_ip set to true - pstmt = conn.prepareStatement("UPDATE `cloud`.`network_offerings` set eip_associate_public_ip=? where id=?"); - pstmt.setBoolean(1, true); - pstmt.setLong(2, id); - pstmt.executeUpdate(); - } - } - } catch (SQLException e) { - throw new CloudRuntimeException("Unable to set elastic_ip_service for network offerings with EIP service enabled.", e); - } finally { - try { - if (rs != null) { - rs.close(); - } - if (pstmt != null) { - pstmt.close(); - } - } catch (SQLException e) { - } - } - } - private void upgradeEgressFirewallRules(Connection conn) { PreparedStatement pstmt = null; ResultSet rs = null;