incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [19/32] git commit: CS-16030: set UUID when persist public ip address
Date Thu, 16 Aug 2012 23:49:03 GMT
CS-16030: set UUID when persist public ip address


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

Branch: refs/heads/4.0
Commit: a74df016a033c74cc2d84f472d425e73ba7bf1cf
Parents: 2b206cc
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Thu Aug 16 10:12:24 2012 -0700
Committer: Alex Huang <alex.huang@citrix.com>
Committed: Thu Aug 16 16:39:58 2012 -0700

----------------------------------------------------------------------
 server/src/com/cloud/test/IPRangeConfig.java |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/a74df016/server/src/com/cloud/test/IPRangeConfig.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/test/IPRangeConfig.java b/server/src/com/cloud/test/IPRangeConfig.java
index efc8801..c8bc76c 100755
--- a/server/src/com/cloud/test/IPRangeConfig.java
+++ b/server/src/com/cloud/test/IPRangeConfig.java
@@ -23,9 +23,9 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.List;
+import java.util.UUID;
 import java.util.Vector;
 
-import com.cloud.network.IpAddress;
 import com.cloud.utils.component.ComponentLocator;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Transaction;
@@ -448,7 +448,7 @@ public class IPRangeConfig {
     }
 	
 	public Vector<String> savePublicIPRange(Transaction txn, long startIP, long endIP,
long zoneId, long vlanDbId, Long sourceNetworkId, long physicalNetworkId) {
-		String insertSql = "INSERT INTO `cloud`.`user_ip_address` (public_ip_address, data_center_id,
vlan_db_id, mac_address, source_network_id, physical_network_id) VALUES (?, ?, ?, (select
mac_address from `cloud`.`data_center` where id=?), ?, ?)";
+		String insertSql = "INSERT INTO `cloud`.`user_ip_address` (public_ip_address, data_center_id,
vlan_db_id, mac_address, source_network_id, physical_network_id, uuid) VALUES (?, ?, ?, (select
mac_address from `cloud`.`data_center` where id=?), ?, ?, ?)";
 		String updateSql = "UPDATE `cloud`.`data_center` set mac_address = mac_address+1 where
id=?";
 		Vector<String> problemIPs = new Vector<String>();
 		PreparedStatement stmt = null;
@@ -469,6 +469,7 @@ public class IPRangeConfig {
     		stmt.setLong(4, zoneId);
     		stmt.setLong(5, sourceNetworkId);
     		stmt.setLong(6, physicalNetworkId);
+    		stmt.setString(7, UUID.randomUUID().toString());
     		stmt.executeUpdate();
     		stmt.close();
     		stmt = conn.prepareStatement(updateSql);


Mime
View raw message