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 2014/07/28 16:04:13 UTC

[01/50] git commit: updated refs/heads/4.4 to d5220a8

Repository: cloudstack
Updated Branches:
  refs/heads/4.4 6eb9a86d9 -> d5220a88a


CLOUDSTACK-6789: UI > User page > fix a bug that a domain-admin was unable to delete other domain-admin in the same domain.

(cherry picked from commit 3d1bbeb262cad98d1b591b42ff5f0e2103dcb1b4)


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

Branch: refs/heads/4.4
Commit: 97e1294eede45109e042290c016957ac9a52f944
Parents: 360e5a2
Author: Jessica Wang <je...@apache.org>
Authored: Tue May 27 15:44:20 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:22 2014 +0200

----------------------------------------------------------------------
 ui/scripts/accounts.js        | 24 +++++++++++++-----------
 ui/scripts/sharedFunctions.js | 12 ------------
 2 files changed, 13 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97e1294e/ui/scripts/accounts.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index 4eaa401..2ebfe82 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -1527,19 +1527,21 @@
                     allowedActions.push("enable");
                 allowedActions.push("remove");
             }
-        } else {
-            if (isSelfOrChildDomainUser(jsonObj.username, jsonObj.accounttype, jsonObj.domainid, jsonObj.iscallerchilddomain)) {
-                if (isDomainAdmin() && jsonObj.username != g_username) {
-                    allowedActions.push("edit");
-                    if (jsonObj.state == "enabled")
-                        allowedActions.push("disable");
-                    if (jsonObj.state == "disabled")
-                        allowedActions.push("enable");
-                    allowedActions.push("remove");
-                }
+        } else { //domain-admin, regular-user
+        	if (jsonObj.username == g_username) { //selected user is self
+        		allowedActions.push("changePassword");
+                allowedActions.push("generateKeys");
+        	} else if (isDomainAdmin()) { //if selected user is not self, and the current login is domain-admin
+        		allowedActions.push("edit");
+                if (jsonObj.state == "enabled")
+                    allowedActions.push("disable");
+                if (jsonObj.state == "disabled")
+                    allowedActions.push("enable");
+                allowedActions.push("remove");
+                
                 allowedActions.push("changePassword");
                 allowedActions.push("generateKeys");
-            }
+        	}        	
         }
         return allowedActions;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97e1294e/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 9cb48a2..d206349 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -765,18 +765,6 @@ var addGuestNetworkDialog = {
         return (g_role == 0);
     }
 
-    function isSelfOrChildDomainUser(username, useraccounttype, userdomainid, iscallerchilddomain) {
-        if (username == g_username) { //is self
-            return true;
-        } else if (isDomainAdmin() && !iscallerchilddomain && (useraccounttype == 0)) { //domain admin to user
-            return true;
-        } else if (isDomainAdmin() && iscallerchilddomain && (userdomainid != g_domainid)) { //domain admin to subdomain admin and user
-            return true;
-        } else {
-            return false;
-        }
-    }
-
     // FUNCTION: Handles AJAX error callbacks.  You can pass in an optional function to
     // handle errors that are not already handled by this method.
 


[48/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-7014: Resolving test script related to affinity groups tests

(cherry picked from commit 1cc6317b5e744afb74b63af6600af32bdfedb888)


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

Branch: refs/heads/4.4
Commit: e9d658e16edbe55a380aefa779c89d690b368d24
Parents: 843e604
Author: Ashutosh K <as...@clogeny.com>
Authored: Wed Jul 16 22:23:59 2014 -0400
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:53 2014 +0200

----------------------------------------------------------------------
 test/integration/component/test_affinity_groups.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e9d658e1/test/integration/component/test_affinity_groups.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py
index 8808034..68902f5 100644
--- a/test/integration/component/test_affinity_groups.py
+++ b/test/integration/component/test_affinity_groups.py
@@ -340,7 +340,7 @@ class TestListAffinityGroups(cloudstackTestCase):
         try:
             cls.api_client = super(TestListAffinityGroups, cls).getClsTestClient().getApiClient()
             #Clean up, terminate the created templates
-            cleanup_resources(cls.api_client, cls.__cleanup)
+            cleanup_resources(cls.api_client, cls._cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
 
@@ -587,7 +587,7 @@ class TestDeleteAffinityGroups(cloudstackTestCase):
         try:
             cls.api_client = super(TestDeleteAffinityGroups, cls).getClsTestClient().getApiClient()
             #Clean up, terminate the created templates
-            cleanup_resources(cls.api_client, cls.__cleanup)
+            cleanup_resources(cls.api_client, cls._cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
 
@@ -857,7 +857,7 @@ class TestUpdateVMAffinityGroups(cloudstackTestCase):
         try:
             cls.api_client = super(TestUpdateVMAffinityGroups, cls).getClsTestClient().getApiClient()
             #Clean up, terminate the created templates
-            cleanup_resources(cls.api_client, cls.__cleanup)
+            cleanup_resources(cls.api_client, cls._cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
 
@@ -1141,7 +1141,7 @@ class TestDeployVMAffinityGroups(cloudstackTestCase):
         try:
             cls.api_client = super(TestDeployVMAffinityGroups, cls).getClsTestClient().getApiClient()
             #Clean up, terminate the created templates
-            cleanup_resources(cls.api_client, cls.__cleanup)
+            cleanup_resources(cls.api_client, cls._cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
 
@@ -1489,7 +1489,7 @@ class TestAffinityGroupsAdminUser(cloudstackTestCase):
         try:
             cls.api_client = super(TestAffinityGroupsAdminUser, cls).getClsTestClient().getApiClient()
             #Clean up, terminate the created templates
-            cleanup_resources(cls.api_client, cls.__cleanup)
+            cleanup_resources(cls.api_client, cls._cleanup)
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
 


[36/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6976: Added the support for SecStorageFirewallCfgCommand

Signed-off-by: Daan Hoogland <da...@onecht.net>
(cherry picked from commit 76f72d3624e8fcbf2ba9d7c200f0f83c197ca967)


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

Branch: refs/heads/4.4
Commit: c513d6f5f17e788b463eefa402ba90c1ab087f01
Parents: 2eae404
Author: Santhosh Edukulla <sa...@gmail.com>
Authored: Mon Jun 23 12:48:48 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:43 2014 +0200

----------------------------------------------------------------------
 .../src/com/cloud/agent/manager/SimulatorManagerImpl.java      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c513d6f5/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
index 3bc689e..7114e16 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
@@ -112,6 +112,7 @@ import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
 import com.cloud.api.commands.CleanupSimulatorMockCmd;
 import com.cloud.api.commands.ConfigureSimulatorCmd;
 import com.cloud.api.commands.QuerySimulatorMockCmd;
+import com.cloud.agent.api.SecStorageFirewallCfgCommand;
 import com.cloud.resource.SimulatorStorageProcessor;
 import com.cloud.simulator.MockConfigurationVO;
 import com.cloud.simulator.MockHost;
@@ -413,9 +414,8 @@ public class SimulatorManagerImpl extends ManagerBase implements SimulatorManage
                     answer = _mockNetworkMgr.setupPVLAN((PvlanSetupCommand)cmd);
                 } else if (cmd instanceof StorageSubSystemCommand) {
                     answer = this.storageHandler.handleStorageCommands((StorageSubSystemCommand)cmd);
-                } else if (cmd instanceof GetRouterAlertsCommand) {
-                    answer = new Answer(cmd);
-                } else if (cmd instanceof VpnUsersCfgCommand || cmd instanceof RemoteAccessVpnCfgCommand || cmd instanceof SetMonitorServiceCommand || cmd instanceof AggregationControlCommand) {
+                } else if (cmd instanceof GetRouterAlertsCommand || cmd instanceof VpnUsersCfgCommand || cmd instanceof RemoteAccessVpnCfgCommand || cmd instanceof SetMonitorServiceCommand || cmd instanceof AggregationControlCommand ||
+                        cmd instanceof SecStorageFirewallCfgCommand) {
                     answer = new Answer(cmd);
                 } else {
                     s_logger.error("Simulator does not implement command of type " + cmd.toString());


[31/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6934: don't try to detach volume from host when volume was never allocated to a primary storage

(cherry picked from commit 92fea032da08938749cde73e312370f1b9da1567)


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

Branch: refs/heads/4.4
Commit: 15ffec2632842b53811cdce4a17b3fb05b6571df
Parents: e988c91
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Wed Jun 18 09:59:23 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:40 2014 +0200

----------------------------------------------------------------------
 .../cloudstack/engine/orchestration/VolumeOrchestrator.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/15ffec26/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index 358b3bd..76281c6 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -866,9 +866,11 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         if (volumesForVm != null) {
             for (VolumeVO volumeForVm : volumesForVm) {
                 VolumeInfo volumeInfo = volFactory.getVolume(volumeForVm.getId());
-                DataStore dataStore = dataStoreMgr.getDataStore(volumeForVm.getPoolId(), DataStoreRole.Primary);
-
-                volService.disconnectVolumeFromHost(volumeInfo, host, dataStore);
+                // pool id can be null for the VM's volumes in Allocated state
+                if (volumeForVm.getPoolId() != null) {
+                    DataStore dataStore = dataStoreMgr.getDataStore(volumeForVm.getPoolId(), DataStoreRole.Primary);
+                    volService.disconnectVolumeFromHost(volumeInfo, host, dataStore);
+                }
             }
         }
     }


[22/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6777: Enable testcase as it looks to be env issue

(cherry picked from commit 79364afcf59f8317aa211959aa2d7ac0959a8d53)


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

Branch: refs/heads/4.4
Commit: 9a76b755b92f4b15615091d9651fee2ac3b91cb2
Parents: 4635279
Author: Girish Shilamkar <gi...@clogeny.com>
Authored: Thu Jun 12 12:20:05 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:32 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_secondary_storage.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9a76b755/test/integration/smoke/test_secondary_storage.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_secondary_storage.py b/test/integration/smoke/test_secondary_storage.py
index 43aa859..240f54f 100644
--- a/test/integration/smoke/test_secondary_storage.py
+++ b/test/integration/smoke/test_secondary_storage.py
@@ -160,7 +160,7 @@ class TestSecStorageServices(cloudstackTestCase):
                         )
         return
 
-    @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"], BugId="CLOUDSTACK-6773, CLOUDSTACK-6777")
+    @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"])
     def test_02_sys_template_ready(self):
         """Test system templates are ready
         """


[12/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6852: UI - modules - add DR fields to volume detailView, network detailView, zone detailView.

(cherry picked from commit 1641b280544e1982f155f82b17d56d0f6ec82e6a)


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

Branch: refs/heads/4.4
Commit: dfb4d9093722658e9528566ddc7f3086ee190c05
Parents: 6519a46
Author: Jessica Wang <je...@apache.org>
Authored: Mon Jun 9 11:38:34 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:28 2014 +0200

----------------------------------------------------------------------
 ui/scripts/network.js | 4 ++++
 ui/scripts/storage.js | 4 ++++
 ui/scripts/system.js  | 7 +++++++
 3 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dfb4d909/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index f934f21..1e0dc3c 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -1383,6 +1383,10 @@
                                         success: function(json) {
                                             var jsonObj = json.listnetworksresponse.network[0];
                                             addExtraPropertiesToGuestNetworkObject(jsonObj);
+                                                                                        
+                                            //if DR module is included                                   
+                                            addExtraPropertiesIfDrModuleIncluded(jsonObj, "Network");                                                            
+                                                                                        
                                             args.response.success({
                                                 actionFilter: cloudStack.actionFilter.guestNetwork,
                                                 data: jsonObj

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dfb4d909/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 5a0580b..0a2d1dc 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -1498,6 +1498,10 @@
                                         async: true,
                                         success: function(json) {
                                             var jsonObj = json.listvolumesresponse.volume[0];
+                                            
+                                            //if DR module is included                                   
+                                            addExtraPropertiesIfDrModuleIncluded(jsonObj, "Volume");
+                                            
                                             args.response.success({
                                                 actionFilter: volumeActionfilter,
                                                 data: jsonObj

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dfb4d909/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 1bcbcbb..f2fda08 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -1954,6 +1954,10 @@
                                                         success: function (json) {
                                                             selectedGuestNetworkObj = json.listnetworksresponse.network[0];
                                                             addExtraPropertiesToGuestNetworkObject(selectedGuestNetworkObj);
+                                                                                                                        
+                                                            //if DR module is included                                   
+                                                            addExtraPropertiesIfDrModuleIncluded(selectedGuestNetworkObj, "Network");                                                            
+                                                            
                                                             args.response.success({
                                                                 actionFilter: cloudStack.actionFilter.guestNetwork,
                                                                 data: selectedGuestNetworkObj
@@ -7591,6 +7595,9 @@
                                                         //override default error handling: cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)});
                                                     });
                                                     
+                                                    //if DR module is included                                   
+                                                    addExtraPropertiesIfDrModuleIncluded(selectedZoneObj, "Zone");
+                                                    
                                                     args.response.success({
                                                         actionFilter: zoneActionfilter,
                                                         data: selectedZoneObj


[46/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Removed invalid assertions from code. Now the MS can be run with assertions enabled (using -ea flag)

(cherry picked from commit 610d6f0b993d7b1f1aae9b072af260fd151de4a0)


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

Branch: refs/heads/4.4
Commit: c72f55f9f35f3b1b2bff0d437497592f6d9f582a
Parents: d14d0d7
Author: Koushik Das <ko...@apache.org>
Authored: Thu Jul 10 12:10:46 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:52 2014 +0200

----------------------------------------------------------------------
 framework/db/src/com/cloud/utils/db/TransactionLegacy.java | 3 ---
 1 file changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c72f55f9/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
index aedf939..3e14a04 100755
--- a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
+++ b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
@@ -112,9 +112,6 @@ public class TransactionLegacy {
         TransactionLegacy txn = tls.get();
         if (check) {
             assert txn != null : "No Transaction on stack.  Did you mark the method with @DB?";
-
-            assert checkAnnotation(4, txn) : "Did you even read the guide to use Transaction...IOW...other people's code? Try method can't be private.  What about @DB? hmmm... could that be it? " +
-                txn;
         }
         return txn;
     }


[13/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6876 Tagged the test_deploy_vgpu_enabled_vm with the relavent bug id.

Signed-off-by: Abhinandan Prateek <ap...@apache.org>
(cherry picked from commit c7013c2ca326ad31047fb6bc689dabc2a6912030)


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

Branch: refs/heads/4.4
Commit: d5eef496cc0e52565d6cc3a82bff4d1761e021e2
Parents: 3d5a7ab
Author: Bharat Kumar <bh...@citrix.com>
Authored: Mon Jun 9 18:30:13 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:29 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_deploy_vgpu_enabled_vm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d5eef496/test/integration/smoke/test_deploy_vgpu_enabled_vm.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py
index 32c6189..38c6d12 100644
--- a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py
+++ b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py
@@ -146,7 +146,7 @@ class TestDeployvGPUenabledVM(cloudstackTestCase):
             self.account
         ]
 
-    @attr(tags = ['advanced', 'simulator', 'basic', 'vgpu', 'provisioning'])
+        @attr(tags = ['advanced', 'simulator', 'basic', 'vgpu', 'provisioning'], BugId="CLOUDSTACK-6876")
     def test_deploy_vgpu_enabled_vm(self):
         """Test Deploy Virtual Machine
 


[50/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-7127: Fix for addRegion failure, avoiding regionid 1 while creating new region through test case

(cherry picked from commit ca59f01602823a6d6fe84233f3a3d3ea499efa06)


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

Branch: refs/heads/4.4
Commit: d5220a88a085385ebc4b783a40f27d128ea7d28f
Parents: 724c8dc
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Thu Jul 24 13:38:38 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:56 2014 +0200

----------------------------------------------------------------------
 test/integration/component/test_regions.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d5220a88/test/integration/component/test_regions.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_regions.py b/test/integration/component/test_regions.py
index b40a48b..2a84943 100644
--- a/test/integration/component/test_regions.py
+++ b/test/integration/component/test_regions.py
@@ -46,7 +46,7 @@ class TestRegions(cloudstackTestCase):
         return
 
     def setUp(self):
-        pseudo_random_int = choice(xrange(1, 200))
+        pseudo_random_int = choice(xrange(2, 200))
         self.services["region"]["regionid"] = pseudo_random_int
         self.services["region"]["regionname"] = "region" + str(pseudo_random_int)
         self.services["region"]["regionendpoint"] = "http://region" + str(pseudo_random_int) + ":8080/client"
@@ -78,7 +78,7 @@ class TestRegions(cloudstackTestCase):
     def test_createRegionWithExistingRegionName(self):
         """Test for duplicate checks on region name
         """
-        random_int = choice(xrange(1, 200))
+        random_int = choice(xrange(2, 200))
         self.services["region"]["regionid"] = random_int  #alter id but not name
         self.services["region"]["regionendpoint"] = "http://region" + str(random_int) + ":8080/client"
         self.assertRaises(Exception, Region.create, self.api_client, self.services["region"])


[28/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
 CLOUDSTACK-6906: Fixed volume resize BVT failure

(cherry picked from commit 8aea23a4e36559e8113d7bc0427aa950ae8082eb)


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

Branch: refs/heads/4.4
Commit: b56246c970cd35b58bf3c0209f066c0e65fa2ce1
Parents: 2422754
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Wed Jun 18 13:04:35 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:38 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_volumes.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b56246c9/test/integration/smoke/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py
index 94e5086..d358c8a 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -545,7 +545,7 @@ class TestVolumes(cloudstackTestCase):
         # first, an invalid id
         cmd                = resizeVolume.resizeVolumeCmd()
         cmd.id             = "invalid id"
-        cmd.diskofferingid = self.services['resizeddiskofferingid']
+        cmd.diskofferingid = self.services['customresizeddiskofferingid']
         success            = False
         try:
             response = self.apiClient.resizeVolume(cmd)
@@ -677,7 +677,7 @@ class TestVolumes(cloudstackTestCase):
 
         cmd                = resizeVolume.resizeVolumeCmd()
         cmd.id             = self.volume.id
-        cmd.diskofferingid = self.services['resizeddiskofferingid']
+        cmd.diskofferingid = self.services['customresizeddiskofferingid']
 
         self.apiClient.resizeVolume(cmd)
 


[20/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6893: fix enum ValueOf issue which causes systemvm fail to start

(cherry picked from commit 63ff5a7cbc3341809884e47796476d47ace03961)


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

Branch: refs/heads/4.4
Commit: d0e0edca111feb71e7cd8267d9c28820d85b12f9
Parents: 4dc62bd
Author: Wei Zhou <w....@leaseweb.com>
Authored: Wed Jun 11 13:46:12 2014 +0200
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:31 2014 +0200

----------------------------------------------------------------------
 .../cloud/hypervisor/kvm/resource/LibvirtComputingResource.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0e0edca/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index b8f33e5..03aa849 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -3977,7 +3977,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
                 if ((volumeObjectTO.getIopsWriteRate() != null) && (volumeObjectTO.getIopsWriteRate() > 0))
                     disk.setIopsWriteRate(volumeObjectTO.getIopsWriteRate());
                 if (volumeObjectTO.getCacheMode() != null)
-                    disk.setCacheMode(DiskDef.diskCacheMode.valueOf(volumeObjectTO.getCacheMode().toString()));
+                    disk.setCacheMode(DiskDef.diskCacheMode.valueOf(volumeObjectTO.getCacheMode().toString().toUpperCase()));
             }
             vm.getDevices().addDevice(disk);
         }
@@ -4128,7 +4128,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv
                     diskdef.setIopsWriteRate(iopsWriteRate);
 
                 if (cacheMode != null) {
-                    diskdef.setCacheMode(DiskDef.diskCacheMode.valueOf(cacheMode));
+                    diskdef.setCacheMode(DiskDef.diskCacheMode.valueOf(cacheMode.toUpperCase()));
                 }
             }
 


[15/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6889: UI - create network offering - remove non-needed parameters from API call whose size might exceed limit in some cases.

(cherry picked from commit 64825549d2eb4e6c55b9cc2730e0ac895473f901)


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

Branch: refs/heads/4.4
Commit: a3e85292ba75d103c1cbe1217446e28cd7c0af58
Parents: dfb4d90
Author: Jessica Wang <je...@apache.org>
Authored: Tue Jun 10 14:26:58 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:29 2014 +0200

----------------------------------------------------------------------
 ui/scripts/configuration.js | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a3e85292/ui/scripts/configuration.js
----------------------------------------------------------------------
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index 3823109..6a4aa42 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -2848,8 +2848,10 @@
                                             inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = 'internal';
                                             serviceCapabilityIndex++;
                                         } 
-                                    } else if (value != '') { // Normal data
-                                        inputData[key] = value;
+                                    } else if (value != '') { // normal data (serviceData.length ==1), e.g. "name", "displayText", "networkRate", "guestIpType", "lbType" (unwanted), "availability" (unwated when value is "Optional"), "egresspolicy", "state" (unwanted), "status" (unwanted), "allocationstate" (unwanted) 
+                                        if (!(key ==  "lbType"  || (key == "availability" && value == "Optional") || key == "state" || key == "status" || key == "allocationstate")) {
+                                            inputData[key] = value;
+                                        }                                        
                                     }
                                 });
 
@@ -2929,10 +2931,7 @@
                                     inputData['serviceProviderList[' + serviceProviderIndex + '].provider'] = value;
                                     serviceProviderIndex++;
                                 });
-
-                                if (args.$form.find('.form-item[rel=availability]').css("display") == "none")
-                                    inputData['availability'] = 'Optional';
-
+                                
                                 if (args.$form.find('.form-item[rel=egresspolicy]').is(':visible')) {
                                     inputData['egressdefaultpolicy'] = formData.egresspolicy === 'ALLOW' ? true : false;
                                 } else {
@@ -2947,8 +2946,7 @@
                                 $.ajax({
                                     url: createURL('createNetworkOffering'),
                                     data: inputData,
-                                    dataType: 'json',
-                                    async: true,
+                                    type: "POST", //use POST instead of GET since the API call might be overlong and exceed size limit
                                     success: function(data) {
                                         var item = data.createnetworkofferingresponse.networkoffering;
 


[11/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6852: UI - modules - add global variable drModuleIncluded.

(cherry picked from commit c29ed73d4d36fbbd8e48cae4217c655d8024c7cc)


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

Branch: refs/heads/4.4
Commit: 4b2756ab9c836f1c16e6d0315017a3f195fb69af
Parents: c9d4395
Author: Jessica Wang <je...@apache.org>
Authored: Fri Jun 6 13:16:27 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:27 2014 +0200

----------------------------------------------------------------------
 ui/scripts/cloudStack.js      | 3 +++
 ui/scripts/sharedFunctions.js | 2 ++
 ui/scripts/storage.js         | 7 ++-----
 3 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4b2756ab/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index be7692d..ad53a4a 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -490,5 +490,8 @@
         }
 
         document.title = _l('label.app.name');
+               
+        // set value to global variable
+        drModuleIncluded = isModuleIncluded("dr");     
     });
 })(cloudStack, jQuery);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4b2756ab/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index c51bc8d..bec0336 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -49,6 +49,8 @@ var md5HashedLogin = false;
 var pageSize = 20;
 //var pageSize = 1; //for testing only
 
+var drModuleIncluded = false;
+
 var rootAccountId = 1;
 
 //async action

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4b2756ab/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 7c19d66..5a0580b 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -904,14 +904,11 @@
                                                         hypervisor: args.context.volumes[0].hypervisor
                                                     });
                                                 }
-
-                                              
-                                                var drModuleIncluded = isModuleIncluded("dr");
+                                                                                              
                                                 var volumeDrEnabled = false;                                               
                                                 if (drModuleIncluded) {
                                                     volumeDrEnabled = cloudStack.dr.sharedFunctions.isVolumeDrEnabled(args.context.volumes[0]);                                                    
-                                                }    
-                                                
+                                                }   
                                                 
                                                 $(['Running', 'Stopped']).each(function() {
                                                     $.ajax({


[34/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Fixed Resource Leaks

Signed-off-by: Daan Hoogland <da...@onecht.net>
(cherry picked from commit c690320f0b10b2465dfcb06581f62299a2fa641c)


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

Branch: refs/heads/4.4
Commit: eb16a4e9e3fb85de4b02e1cbfa47ebbeca45463e
Parents: 20a457d
Author: Santhosh Edukulla <sa...@gmail.com>
Authored: Mon Jun 23 11:40:36 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:42 2014 +0200

----------------------------------------------------------------------
 .../cloud/upgrade/dao/DatabaseAccessObject.java | 54 ++++++--------
 .../utils/crypt/EncryptionSecretKeyChanger.java | 18 +++--
 .../db/src/com/cloud/utils/db/ScriptRunner.java | 74 +++++++++-----------
 .../jobs/dao/AsyncJobJoinMapDaoImpl.java        | 39 ++++++-----
 4 files changed, 83 insertions(+), 102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/eb16a4e9/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java b/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java
index 836a537..4cc88bd 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java
@@ -26,63 +26,49 @@ public class DatabaseAccessObject {
 
     private static Logger s_logger = Logger.getLogger(DatabaseAccessObject.class);
 
-    public void dropKey(Connection conn, String tableName, String key, boolean isForeignKey) {
-        PreparedStatement pstmt = null;
-        try {
-            if (isForeignKey) {
-                pstmt = conn.prepareStatement("ALTER TABLE " + tableName + " DROP FOREIGN KEY " + key);
-            } else {
-                pstmt = conn.prepareStatement("ALTER TABLE " + tableName + " DROP KEY " + key);
-            }
+    public void dropKey(Connection conn, String tableName, String key, boolean isForeignKey)
+    {
+        String alter_sql_str;
+        if (isForeignKey) {
+            alter_sql_str = "ALTER TABLE " + tableName + " DROP FOREIGN KEY " + key;
+        } else {
+            alter_sql_str = "ALTER TABLE " + tableName + " DROP KEY " + key;
+        }
+        try(PreparedStatement pstmt = conn.prepareStatement(alter_sql_str);)
+        {
             pstmt.executeUpdate();
             s_logger.debug("Key " + key + " is dropped successfully from the table " + tableName);
         } catch (SQLException e) {
-            s_logger.warn("Ignored SQL Exception when trying to drop " + (isForeignKey ? "foreign " : "") + "key " + key + " on table " + tableName, e);
-        } finally {
-            closePreparedStatement(pstmt, "Ignored SQL Exception when trying to close PreparedStatement atfer dropping " + (isForeignKey ? "foreign " : "") + "key " + key
-                    + " on table " + tableName);
+            s_logger.warn("dropKey:Exception:"+e.getMessage());
         }
     }
 
     public void dropPrimaryKey(Connection conn, String tableName) {
-        PreparedStatement pstmt = null;
-        try {
-            pstmt = conn.prepareStatement("ALTER TABLE " + tableName + " DROP PRIMARY KEY ");
+        try(PreparedStatement pstmt = conn.prepareStatement("ALTER TABLE " + tableName + " DROP PRIMARY KEY ");) {
             pstmt.executeUpdate();
             s_logger.debug("Primary key is dropped successfully from the table " + tableName);
-        } catch (SQLException e) {
-            s_logger.warn("Ignored SQL Exception when trying to drop primary key on table " + tableName, e);
-        } finally {
-            closePreparedStatement(pstmt, "Ignored SQL Exception when trying to close PreparedStatement atfer dropping primary key on table " + tableName);
+        } catch (Exception e) {
+            s_logger.warn("dropPrimaryKey:Exception:"+e.getMessage());
         }
     }
 
     public void dropColumn(Connection conn, String tableName, String columnName) {
-        PreparedStatement pstmt = null;
-        try {
-            pstmt = conn.prepareStatement("ALTER TABLE " + tableName + " DROP COLUMN " + columnName);
+        try (PreparedStatement pstmt = conn.prepareStatement("ALTER TABLE " + tableName + " DROP COLUMN " + columnName);){
             pstmt.executeUpdate();
             s_logger.debug("Column " + columnName + " is dropped successfully from the table " + tableName);
-        } catch (SQLException e) {
-            s_logger.warn("Unable to drop columns using query " + pstmt + " due to exception", e);
-        } finally {
-            closePreparedStatement(pstmt, "Ignored SQL Exception when trying to close PreparedStatement after dropping column " + columnName + " on table " + tableName);
+        } catch (Exception e) {
+            s_logger.warn("dropColumn:Exception:"+e.getMessage());
         }
     }
 
     public boolean columnExists(Connection conn, String tableName, String columnName) {
         boolean columnExists = false;
-        PreparedStatement pstmt = null;
-        try {
-            pstmt = conn.prepareStatement("SELECT " + columnName + " FROM " + tableName);
+        try (PreparedStatement pstmt = conn.prepareStatement("SELECT " + columnName + " FROM " + tableName);){
             pstmt.executeQuery();
             columnExists = true;
-        } catch (SQLException e) {
-            s_logger.warn("Field " + columnName + " doesn't exist in " + tableName, e);
-        } finally {
-            closePreparedStatement(pstmt, "Ignored SQL Exception when trying to close PreparedStatement atfer checking if column " + columnName + " existed on table " + tableName);
+        } catch (Exception e) {
+            s_logger.warn("columnExists:Exception:"+e.getMessage());
         }
-
         return columnExists;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/eb16a4e9/framework/db/src/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java b/framework/db/src/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java
index 4cee081..ae103ff 100755
--- a/framework/db/src/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java
+++ b/framework/db/src/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java
@@ -105,8 +105,8 @@ public class EncryptionSecretKeyChanger {
         PropertiesConfiguration backupDBProps = null;
 
         System.out.println("Parsing db.properties file");
-        try {
-            dbProps.load(new FileInputStream(dbPropsFile));
+        try(FileInputStream db_prop_fstream = new FileInputStream(dbPropsFile);) {
+            dbProps.load(db_prop_fstream);
             backupDBProps = new PropertiesConfiguration(dbPropsFile);
         } catch (FileNotFoundException e) {
             System.out.println("db.properties file not found while reading DB secret key" + e.getMessage());
@@ -142,11 +142,10 @@ public class EncryptionSecretKeyChanger {
                 //db.properties updated successfully
                 if (encryptionType.equals("file")) {
                     //update key file with new MS key
-                    try {
-                        FileWriter fwriter = new FileWriter(keyFile);
-                        BufferedWriter bwriter = new BufferedWriter(fwriter);
+                    try (FileWriter fwriter = new FileWriter(keyFile);
+                         BufferedWriter bwriter = new BufferedWriter(fwriter);)
+                    {
                         bwriter.write(newMSKey);
-                        bwriter.close();
                     } catch (IOException e) {
                         System.out.println("Failed to write new secret to file. Please update the file manually");
                     }
@@ -180,11 +179,10 @@ public class EncryptionSecretKeyChanger {
             }
             if (encryptionType.equals("file")) {
                 //revert secret key in file
-                try {
-                    FileWriter fwriter = new FileWriter(keyFile);
-                    BufferedWriter bwriter = new BufferedWriter(fwriter);
+                try (FileWriter fwriter = new FileWriter(keyFile);
+                     BufferedWriter bwriter = new BufferedWriter(fwriter);)
+                {
                     bwriter.write(oldMSKey);
-                    bwriter.close();
                 } catch (IOException e) {
                     System.out.println("Failed to revert to old secret to file. Please update the file manually");
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/eb16a4e9/framework/db/src/com/cloud/utils/db/ScriptRunner.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/ScriptRunner.java b/framework/db/src/com/cloud/utils/db/ScriptRunner.java
index 932b37b..45494b9 100644
--- a/framework/db/src/com/cloud/utils/db/ScriptRunner.java
+++ b/framework/db/src/com/cloud/utils/db/ScriptRunner.java
@@ -131,52 +131,44 @@ public class ScriptRunner {
                 } else if (!fullLineDelimiter && trimmedLine.endsWith(getDelimiter()) || fullLineDelimiter && trimmedLine.equals(getDelimiter())) {
                     command.append(line.substring(0, line.lastIndexOf(getDelimiter())));
                     command.append(" ");
-                    Statement statement = conn.createStatement();
-
-                    println(command);
-
-                    boolean hasResults = false;
-                    if (stopOnError) {
-                        hasResults = statement.execute(command.toString());
-                    } else {
-                        try {
-                            statement.execute(command.toString());
-                        } catch (SQLException e) {
-                            e.fillInStackTrace();
-                            printlnError("Error executing: " + command);
-                            printlnError(e);
+                    try (Statement statement = conn.createStatement();) {
+                        println(command);
+                        boolean hasResults = false;
+                        if (stopOnError) {
+                            hasResults = statement.execute(command.toString());
+                        } else {
+                            try {
+                                statement.execute(command.toString());
+                            } catch (SQLException e) {
+                                e.fillInStackTrace();
+                                printlnError("Error executing: " + command);
+                                printlnError(e);
+                            }
                         }
-                    }
-
-                    if (autoCommit && !conn.getAutoCommit()) {
-                        conn.commit();
-                    }
-
-                    ResultSet rs = statement.getResultSet();
-                    if (hasResults && rs != null) {
-                        ResultSetMetaData md = rs.getMetaData();
-                        int cols = md.getColumnCount();
-                        for (int i = 0; i < cols; i++) {
-                            String name = md.getColumnLabel(i);
-                            print(name + "\t");
+                        if (autoCommit && !conn.getAutoCommit()) {
+                            conn.commit();
                         }
-                        println("");
-                        while (rs.next()) {
-                            for (int i = 1; i <= cols; i++) {
-                                String value = rs.getString(i);
-                                print(value + "\t");
+                        try(ResultSet rs = statement.getResultSet();) {
+                            if (hasResults && rs != null) {
+                                ResultSetMetaData md = rs.getMetaData();
+                                int cols = md.getColumnCount();
+                                for (int i = 0; i < cols; i++) {
+                                    String name = md.getColumnLabel(i);
+                                    print(name + "\t");
+                                }
+                                println("");
+                                while (rs.next()) {
+                                    for (int i = 1; i <= cols; i++) {
+                                        String value = rs.getString(i);
+                                        print(value + "\t");
+                                    }
+                                    println("");
+                                }
                             }
-                            println("");
+                            command = null;
+                            Thread.yield();
                         }
                     }
-
-                    command = null;
-                    try {
-                        statement.close();
-                    } catch (Exception e) {
-                        // Ignore to workaround a bug in Jakarta DBCP
-                    }
-                    Thread.yield();
                 } else {
                     int idx = line.indexOf("--");
                     if (idx != -1)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/eb16a4e9/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java
index 7bc29db..fcdea76 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java
@@ -214,12 +214,14 @@ public class AsyncJobJoinMapDaoImpl extends GenericDaoBase<AsyncJobJoinMapVO, Lo
         List<Long> standaloneList = new ArrayList<Long>();
         TransactionLegacy txn = TransactionLegacy.currentTxn();
         String sql = "SELECT job_id FROM async_job_join_map WHERE join_job_id = ? AND job_id NOT IN (SELECT content_id FROM sync_queue_item)";
-        try {
-            PreparedStatement pstmt = txn.prepareStatement(sql);
+        try (PreparedStatement pstmt = txn.prepareStatement(sql);){
             pstmt.setLong(1, joinedJobId);
-            ResultSet rs = pstmt.executeQuery();
-            while (rs.next()) {
-                standaloneList.add(rs.getLong(1));
+            try(ResultSet rs = pstmt.executeQuery();) {
+                while (rs.next()) {
+                    standaloneList.add(rs.getLong(1));
+                }
+            }catch (SQLException e) {
+                throw new CloudRuntimeException("Unable to execute " + sql, e);
             }
         } catch (SQLException e) {
             throw new CloudRuntimeException("Unable to execute " + sql, e);
@@ -231,23 +233,26 @@ public class AsyncJobJoinMapDaoImpl extends GenericDaoBase<AsyncJobJoinMapVO, Lo
     public List<Long> findJobsToWakeBetween(Date cutDate) {
         List<Long> standaloneList = new ArrayList<Long>();
         TransactionLegacy txn = TransactionLegacy.currentTxn();
-        try {
-            String sql = "SELECT job_id FROM async_job_join_map WHERE next_wakeup < ? AND expiration > ? AND job_id NOT IN (SELECT content_id FROM sync_queue_item)";
-            PreparedStatement pstmt = txn.prepareStatement(sql);
+        String sql = "SELECT job_id FROM async_job_join_map WHERE next_wakeup < ? AND expiration > ? AND job_id NOT IN (SELECT content_id FROM sync_queue_item)";
+        try (PreparedStatement pstmt = txn.prepareStatement(sql);){
             pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
             pstmt.setString(2, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
-            ResultSet rs = pstmt.executeQuery();
-            while (rs.next()) {
-                standaloneList.add(rs.getLong(1));
+            try(ResultSet rs = pstmt.executeQuery();) {
+                while (rs.next()) {
+                    standaloneList.add(rs.getLong(1));
+                }
+            }catch (SQLException e) {
+                throw new CloudRuntimeException("Unable to handle SQL exception", e);
             }
-
             // update for next wake-up
             sql = "UPDATE async_job_join_map SET next_wakeup=DATE_ADD(next_wakeup, INTERVAL wakeup_interval SECOND) WHERE next_wakeup < ? AND expiration > ?";
-            pstmt = txn.prepareStatement(sql);
-            pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
-            pstmt.setString(2, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
-            pstmt.executeUpdate();
-
+            try(PreparedStatement update_pstmt = txn.prepareStatement(sql);) {
+                update_pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
+                update_pstmt.setString(2, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
+                update_pstmt.executeUpdate();
+            }catch (SQLException e) {
+                throw new CloudRuntimeException("Unable to handle SQL exception", e);
+            }
             return standaloneList;
         } catch (SQLException e) {
             throw new CloudRuntimeException("Unable to handle SQL exception", e);


[10/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6858: UI - remove obsolete variable rootAccountId whose value is no longer 1.

(cherry picked from commit d991e37865106e79a6a31e4af3a34b2446058eef)


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

Branch: refs/heads/4.4
Commit: 8a58bd3fedf46c1fc9664a08ef3da7e045746089
Parents: 4b2756a
Author: Jessica Wang <je...@apache.org>
Authored: Fri Jun 6 13:26:53 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:27 2014 +0200

----------------------------------------------------------------------
 ui/scripts/sharedFunctions.js | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8a58bd3f/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index bec0336..445351a 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -51,8 +51,6 @@ var pageSize = 20;
 
 var drModuleIncluded = false;
 
-var rootAccountId = 1;
-
 //async action
 var pollAsyncJobResult = function(args) {
     $.ajax({
@@ -1183,10 +1181,7 @@ var addExtraPropertiesToGuestNetworkObject = function(jsonObj) {
     jsonObj.networkofferingidText = jsonObj.networkofferingid;
 
     if (jsonObj.acltype == "Domain") {
-        if (jsonObj.domainid == rootAccountId)
-            jsonObj.scope = "All";
-        else
-            jsonObj.scope = "Domain (" + jsonObj.domain + ")";
+        jsonObj.scope = "Domain (" + jsonObj.domain + ")";
     } else if (jsonObj.acltype == "Account") {
         if (jsonObj.project != null)
             jsonObj.scope = "Account (" + jsonObj.domain + ", " + jsonObj.project + ")";


[18/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6878 Tagged the testcase test_01_snapshot_root_disk with the bugId

Signed-off-by: Abhinandan Prateek <ap...@apache.org>
(cherry picked from commit 93c692ea289a7e42dbe4d7051ee1aa78fbd51471)


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

Branch: refs/heads/4.4
Commit: 5bbf287837f183096f72416ec36b16b5035566f4
Parents: d5eef49
Author: Bharat Kumar <bh...@citrix.com>
Authored: Mon Jun 9 18:45:40 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:30 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_snapshots.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5bbf2878/test/integration/smoke/test_snapshots.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_snapshots.py b/test/integration/smoke/test_snapshots.py
index 8b33452..e3bd186 100644
--- a/test/integration/smoke/test_snapshots.py
+++ b/test/integration/smoke/test_snapshots.py
@@ -196,7 +196,7 @@ class TestSnapshotRootDisk(cloudstackTestCase):
         return
 
     @attr(speed = "slow")
-    @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"])
+    @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"], BugId="CLOUDSTACK-6878")
     def test_01_snapshot_root_disk(self):
         """Test Snapshot Root Disk
         """


[04/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Disabling the failed test cases mentioned in the following tickets integration.smoke.test_iso - CLOUDSTACK-6769, CLOUDSTACK-6774

Signed-off-by: Abhinandan Prateek <ap...@apache.org>
(cherry picked from commit 80b9849981a608e46945da1ab813cd78f4bb8bcc)


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

Branch: refs/heads/4.4
Commit: c6a6b5b698244027e2bb2cb79a63609027f0b2e3
Parents: 97e1294
Author: Harikrishna Patnala <ha...@citrix.com>
Authored: Wed May 28 11:39:37 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:23 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_iso.py | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c6a6b5b6/test/integration/smoke/test_iso.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py
index 1cb9058..9887af0 100644
--- a/test/integration/smoke/test_iso.py
+++ b/test/integration/smoke/test_iso.py
@@ -189,6 +189,7 @@ class TestCreateIso(cloudstackTestCase):
 class TestISO(cloudstackTestCase):
 
     @classmethod
+    @attr(BugId="CLOUDSTACK-6769, CLOUDSTACK-6774")
     def setUpClass(cls):
         cls.services = Services().services
         cls.api_client = super(TestISO, cls).getClsTestClient().getApiClient()


[47/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-7025: Resolving test script issue

(cherry picked from commit 33fdfbc83407037b45624ca84ca436fab72e59ab)


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

Branch: refs/heads/4.4
Commit: 843e60475798a2cb06daeaa00708c816fb819650
Parents: c72f55f
Author: Ashutosh K <as...@clogeny.com>
Authored: Wed Jul 16 21:57:01 2014 -0400
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:53 2014 +0200

----------------------------------------------------------------------
 test/integration/component/test_add_remove_network.py | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/843e6047/test/integration/component/test_add_remove_network.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py
index 4529ec7..b2b3594 100644
--- a/test/integration/component/test_add_remove_network.py
+++ b/test/integration/component/test_add_remove_network.py
@@ -201,6 +201,8 @@ class TestAddNetworkToVirtualMachine(cloudstackTestCase):
                                                     domainid=cls.account.domainid, serviceofferingid=cls.service_offering.id,
                                                     mode=cls.zone.networktype)
 
+        cls.defaultNetworkId = cls.virtual_machine.nic[0].networkid
+
         # Create Shared Network Offering
         cls.isolated_network_offering = NetworkOffering.create(cls.api_client, cls.services["isolated_network_offering"])
         # Enable Isolated Network offering


[35/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Fixed failing DatabaseAccessObject unit test cases

Signed-off-by: Daan Hoogland <da...@onecht.net>
(cherry picked from commit ff46258022a4f61f05f8c011fa7dbe68175770df)


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

Branch: refs/heads/4.4
Commit: 2eae404cf7dc2e706407bb254335749b5b7defcd
Parents: eb16a4e
Author: Santhosh Edukulla <sa...@gmail.com>
Authored: Mon Jun 23 16:22:46 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:43 2014 +0200

----------------------------------------------------------------------
 .../com/cloud/upgrade/dao/DatabaseAccessObject.java  | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2eae404c/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java b/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java
index 4cc88bd..1e620a5 100644
--- a/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/DatabaseAccessObject.java
@@ -39,7 +39,8 @@ public class DatabaseAccessObject {
             pstmt.executeUpdate();
             s_logger.debug("Key " + key + " is dropped successfully from the table " + tableName);
         } catch (SQLException e) {
-            s_logger.warn("dropKey:Exception:"+e.getMessage());
+            s_logger.warn("Ignored SQL Exception when trying to drop " + (isForeignKey ? "foreign " : "") + "key " + key + " on table "  + tableName, e);
+
         }
     }
 
@@ -47,8 +48,8 @@ public class DatabaseAccessObject {
         try(PreparedStatement pstmt = conn.prepareStatement("ALTER TABLE " + tableName + " DROP PRIMARY KEY ");) {
             pstmt.executeUpdate();
             s_logger.debug("Primary key is dropped successfully from the table " + tableName);
-        } catch (Exception e) {
-            s_logger.warn("dropPrimaryKey:Exception:"+e.getMessage());
+        } catch (SQLException e) {
+            s_logger.warn("Ignored SQL Exception when trying to drop primary key on table " + tableName, e);
         }
     }
 
@@ -56,8 +57,8 @@ public class DatabaseAccessObject {
         try (PreparedStatement pstmt = conn.prepareStatement("ALTER TABLE " + tableName + " DROP COLUMN " + columnName);){
             pstmt.executeUpdate();
             s_logger.debug("Column " + columnName + " is dropped successfully from the table " + tableName);
-        } catch (Exception e) {
-            s_logger.warn("dropColumn:Exception:"+e.getMessage());
+        } catch (SQLException e) {
+            s_logger.warn("Unable to drop column " + columnName + " due to exception", e);
         }
     }
 
@@ -66,8 +67,8 @@ public class DatabaseAccessObject {
         try (PreparedStatement pstmt = conn.prepareStatement("SELECT " + columnName + " FROM " + tableName);){
             pstmt.executeQuery();
             columnExists = true;
-        } catch (Exception e) {
-            s_logger.warn("columnExists:Exception:"+e.getMessage());
+        } catch (SQLException e) {
+            s_logger.warn("Field " + columnName + " doesn't exist in " + tableName, e);
         }
         return columnExists;
     }


[44/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-7029: listCapacity fails when podid argument is specified.

(cherry picked from commit ef2cf137a5b848511c546d2ce96ef1691cacb063)


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

Branch: refs/heads/4.4
Commit: 3d62fbc6e54003f499faec6f67a39ff4f830cb81
Parents: bb5ba26
Author: Sanjay Tripathi <sa...@citrix.com>
Authored: Wed Jul 9 12:07:15 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:51 2014 +0200

----------------------------------------------------------------------
 engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3d62fbc6/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
index bcd6fa7..df023bf 100644
--- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
@@ -659,12 +659,12 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem
         finalQuery.append(COUNT_VMS_BASED_ON_VGPU_TYPES1);
 
         if (podId != null) {
-            finalQuery.append(" AND host.pod_id = ?");
+            finalQuery.append("AND host.pod_id = ? ");
             resourceIdList.add(podId);
         }
 
         if (clusterId != null) {
-            finalQuery.append(" AND host.cluster_id = ?");
+            finalQuery.append("AND host.cluster_id = ? ");
             resourceIdList.add(clusterId);
         }
         finalQuery.append(COUNT_VMS_BASED_ON_VGPU_TYPES2);


[49/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-7125: Fixed test_blocker_bugs.py, added code to wait for snapshots to be in 'BackedU' state

(cherry picked from commit 4395308bd8b469fb02fc71d1e22f25c7d89b6dff)


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

Branch: refs/heads/4.4
Commit: 724c8dc7c98574dcdf669c0c2d7549981667ab77
Parents: e9d658e
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Thu Jul 24 15:21:28 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:56 2014 +0200

----------------------------------------------------------------------
 test/integration/component/test_blocker_bugs.py | 45 +++-----------------
 1 file changed, 5 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/724c8dc7/test/integration/component/test_blocker_bugs.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py
index 98bed92..2828032 100644
--- a/test/integration/component/test_blocker_bugs.py
+++ b/test/integration/component/test_blocker_bugs.py
@@ -841,26 +841,9 @@ class TestTemplates(cloudstackTestCase):
                                    account=self.account.name,
                                    domainid=self.account.domainid
                                    )
-        self.debug("Created snapshot with ID: %s" % snapshot.id)
-        snapshots = Snapshot.list(
-                                   self.apiclient,
-                                   id=snapshot.id
-                                   )
-        self.assertEqual(
-                            isinstance(snapshots, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        self.assertNotEqual(
-                            snapshots,
-                            None,
-                            "Check if result exists in list snapshots call"
-                            )
-        self.assertEqual(
-                            snapshots[0].id,
-                            snapshot.id,
-                            "Check snapshot id in list resources call"
-                        )
+
+        response = snapshot.validateState(self.apiclient, Snapshot.BACKED_UP)
+        self.assertEqual(response[0], PASS, response[1])
 
         # Generate template from the snapshot
         template = Template.create_from_snapshot(
@@ -923,26 +906,8 @@ class TestTemplates(cloudstackTestCase):
                                    account=self.account.name,
                                    domainid=self.account.domainid
                                    )
-        self.debug("Created snapshot with ID: %s" % snapshot.id)
-        snapshots = Snapshot.list(
-                                   self.apiclient,
-                                   id=snapshot.id
-                                   )
-        self.assertEqual(
-                            isinstance(snapshots, list),
-                            True,
-                            "Check list response returns a valid list"
-                        )
-        self.assertNotEqual(
-                            snapshots,
-                            None,
-                            "Check if result exists in list snapshots call"
-                            )
-        self.assertEqual(
-                            snapshots[0].id,
-                            snapshot.id,
-                            "Check snapshot id in list resources call"
-                        )
+        response = snapshot.validateState(self.apiclient, Snapshot.BACKED_UP)
+        self.assertEqual(response[0], PASS, response[1])
 
         # Generate template from the snapshot
         template = Template.create_from_snapshot(


[45/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Some minor fixes in simulator code

(cherry picked from commit a0486aedca24dfa7ea58bc72caa882d6dc57611d)


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

Branch: refs/heads/4.4
Commit: d14d0d7c92c0cabb6610e289df9c15c8b2040722
Parents: 3d62fbc
Author: Koushik Das <ko...@apache.org>
Authored: Wed Jul 9 12:27:47 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:51 2014 +0200

----------------------------------------------------------------------
 .../src/com/cloud/agent/manager/MockStorageManagerImpl.java    | 6 +++---
 .../simulator/src/com/cloud/resource/SimulatorDiscoverer.java  | 5 -----
 .../src/com/cloud/resource/SimulatorSecondaryDiscoverer.java   | 3 ---
 3 files changed, 3 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d14d0d7c/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
index 8e1aaed..89b7950 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
@@ -289,11 +289,11 @@ public class MockStorageManagerImpl extends ManagerBase implements MockStorageMa
             vm = _mockVMDao.findByVmName(vmName);
             txn.commit();
             if (vm == null) {
-                return new Answer(cmd, false, "can't vm :" + vmName);
+                return new Answer(cmd, false, "can't find vm :" + vmName);
             }
         } catch (Exception ex) {
             txn.rollback();
-            throw new CloudRuntimeException("Error when attaching iso to vm " + vm.getName(), ex);
+            throw new CloudRuntimeException("Error when attaching iso to vm " + vmName, ex);
         } finally {
             txn.close();
             txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB);
@@ -514,8 +514,8 @@ public class MockStorageManagerImpl extends ManagerBase implements MockStorageMa
 
             if (cmd.getVmName() != null) {
                 MockVm vm = _mockVMDao.findByVmName(cmd.getVmName());
-                vm.setState(State.Expunging);
                 if (vm != null) {
+                    vm.setState(State.Expunging);
                     MockVMVO vmVo = _mockVMDao.createForUpdate(vm.getId());
                     _mockVMDao.update(vm.getId(), vmVo);
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d14d0d7c/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
index d1ebfb5..7c31a9a 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorDiscoverer.java
@@ -41,7 +41,6 @@ import com.cloud.agent.api.StartupRoutingCommand;
 import com.cloud.agent.manager.MockAgentManager;
 import com.cloud.agent.manager.MockStorageManager;
 import com.cloud.dc.ClusterVO;
-import com.cloud.dc.dao.ClusterDao;
 import com.cloud.exception.ConnectionException;
 import com.cloud.exception.DiscoveryException;
 import com.cloud.host.Host;
@@ -65,15 +64,11 @@ public class SimulatorDiscoverer extends DiscovererBase implements Discoverer, L
     @Inject
     VMTemplateZoneDao _vmTemplateZoneDao;
     @Inject
-    ClusterDao _clusterDao;
-    @Inject
     AgentManager _agentMgr = null;
     @Inject
     MockAgentManager _mockAgentMgr = null;
     @Inject
     MockStorageManager _mockStorageMgr = null;
-    @Inject
-    ResourceManager _resourceMgr;
 
     /**
      * Finds ServerResources of an in-process simulator

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d14d0d7c/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
index 715e9f3..11bf346 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
@@ -31,7 +31,6 @@ import org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer;
 import org.apache.cloudstack.storage.resource.SecondaryStorageResource;
 import org.apache.log4j.Logger;
 
-import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
 import com.cloud.agent.api.AgentControlAnswer;
 import com.cloud.agent.api.AgentControlCommand;
@@ -52,8 +51,6 @@ public class SimulatorSecondaryDiscoverer extends SecondaryStorageDiscoverer imp
     @Inject
     MockStorageManager _mockStorageMgr = null;
     @Inject
-    AgentManager _agentMgr;
-    @Inject
     SnapshotDao _snapshotDao;
     @Inject
     ImageStoreDao imageStoreDao;


[38/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6732: Fix:[OVS][UI] Network Service Providers page displays two ovs providers

(cherry picked from commit 6d5d48f460438c7df43e3d0e3da9bd91866c53d5)


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

Branch: refs/heads/4.4
Commit: b0c6de63fdf27e4843eae30b0cddad9649e91b84
Parents: 446899d
Author: Gabor Apati-Nagy <ga...@citrix.com>
Authored: Thu May 29 15:02:29 2014 +0100
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:47 2014 +0200

----------------------------------------------------------------------
 ui/scripts/system.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b0c6de63/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index e6fb7a6..d619906 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -6177,7 +6177,7 @@
                                     args.response.success({
                                         actionFilter: virtualRouterProviderActionFilter,
                                         data: $.extend(nspMap[ "Ovs"], {
-                                            supportedServices: nspMap[ "Ovs"].servicelist.join(', ')
+                                            supportedServices: nspMap["Ovs"] == undefined? "": nspMap["Ovs"].servicelist.join(', ')
                                         })
                                     });
                                 }
@@ -19434,11 +19434,14 @@
             });
         }
         
+        if ($.grep(nspHardcodingArray, function(e) { return e.id == 'Ovs'; }).length == 0 ) {
         nspHardcodingArray.push({
-            id: 'OVS',
-            name: 'OVS',
+                id: 'Ovs',
+                name: 'Ovs',
             state: nspMap.Ovs ? nspMap.Ovs.state : 'Disabled'
         });        
+        }
+
     };
     
     cloudStack.actionFilter.physicalNetwork = function (args) {


[21/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Make CreateVpnGatewayCmd implements BaseAsyncCreateCmd

Instead of BaseAsyncCmd.

(cherry picked from commit 4c168bf9dbb6b7f3bc9b39fa6f270a4487496a16)


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

Branch: refs/heads/4.4
Commit: 463527940a5ef48523fb05924391e95ead860678
Parents: 20c3f1c
Author: Sheng Yang <sh...@citrix.com>
Authored: Wed Jun 11 18:34:50 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:32 2014 +0200

----------------------------------------------------------------------
 .../command/user/vpn/CreateVpnGatewayCmd.java   | 30 ++++++++++++++------
 1 file changed, 21 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/46352794/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
index fb933ba..3043edc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
@@ -16,25 +16,26 @@
 // under the License.
 package org.apache.cloudstack.api.command.user.vpn;
 
-import org.apache.log4j.Logger;
-
+import com.cloud.event.EventTypes;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.network.Site2SiteVpnGateway;
+import com.cloud.network.vpc.Vpc;
 import org.apache.cloudstack.acl.RoleType;
 import org.apache.cloudstack.api.APICommand;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
 import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
 import org.apache.cloudstack.api.response.VpcResponse;
-
-import com.cloud.event.EventTypes;
-import com.cloud.network.Site2SiteVpnGateway;
-import com.cloud.network.vpc.Vpc;
+import org.apache.cloudstack.context.CallContext;
+import org.apache.log4j.Logger;
 
 @APICommand(name = "createVpnGateway", description = "Creates site to site vpn local gateway", responseObject = Site2SiteVpnGatewayResponse.class, entityType = {Site2SiteVpnGateway.class},
         requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
-public class CreateVpnGatewayCmd extends BaseAsyncCmd {
+public class CreateVpnGatewayCmd extends BaseAsyncCreateCmd {
     public static final Logger s_logger = Logger.getLogger(CreateVpnGatewayCmd.class.getName());
 
     private static final String s_name = "createvpngatewayresponse";
@@ -101,8 +102,8 @@ public class CreateVpnGatewayCmd extends BaseAsyncCmd {
 
     @Override
     public void execute() {
-        Site2SiteVpnGateway result;
-        result = _s2sVpnService.createVpnGateway(this);
+        CallContext.current().setEventDetails("VPN gateway Id: " + getEntityId());
+        Site2SiteVpnGateway result = _s2sVpnService.getVpnGateway(getEntityId());
         if (result != null) {
             Site2SiteVpnGatewayResponse response = _responseGenerator.createSite2SiteVpnGatewayResponse(result);
             response.setResponseName(getCommandName());
@@ -121,4 +122,15 @@ public class CreateVpnGatewayCmd extends BaseAsyncCmd {
     public Long getSyncObjId() {
         return getVpcId();
     }
+
+    @Override
+    public void create() throws ResourceAllocationException {
+        Site2SiteVpnGateway result = _s2sVpnService.createVpnGateway(this);
+        if (result != null) {
+            setEntityId(result.getId());
+            setEntityUuid(result.getUuid());
+        } else {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create VPN gateway");
+        }
+    }
 }


[08/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6852: UI - attach volume action - VM dropdown - populate options based on whether module is included and whether service is enabled.

(cherry picked from commit 9b9154132dbd41acddf4365779fc8af13a2acc4c)


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

Branch: refs/heads/4.4
Commit: c9d4395bba3dfe15992464808e124395208644f0
Parents: f769763
Author: Jessica Wang <je...@apache.org>
Authored: Thu Jun 5 13:44:57 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:26 2014 +0200

----------------------------------------------------------------------
 ui/scripts/storage.js | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c9d4395b/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 74d0201..7c19d66 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -905,6 +905,14 @@
                                                     });
                                                 }
 
+                                              
+                                                var drModuleIncluded = isModuleIncluded("dr");
+                                                var volumeDrEnabled = false;                                               
+                                                if (drModuleIncluded) {
+                                                    volumeDrEnabled = cloudStack.dr.sharedFunctions.isVolumeDrEnabled(args.context.volumes[0]);                                                    
+                                                }    
+                                                
+                                                
                                                 $(['Running', 'Stopped']).each(function() {
                                                     $.ajax({
                                                         url: createURL('listVirtualMachines'),
@@ -914,11 +922,21 @@
                                                         async: false,
                                                         success: function(json) {
                                                             var instanceObjs = json.listvirtualmachinesresponse.virtualmachine;
-                                                            $(instanceObjs).each(function() {
-                                                                items.push({
-                                                                    id: this.id,
-                                                                    description: this.displayname ? this.displayname : this.name
-                                                                });
+                                                            $(instanceObjs).each(function() {                                                               
+                                                                if (drModuleIncluded) {
+                                                                    var vmDrEnabled = cloudStack.dr.sharedFunctions.isVmDrEnabled(this);
+                                                                    if (vmDrEnabled == volumeDrEnabled) {
+                                                                        items.push({
+                                                                            id: this.id,
+                                                                            description: this.displayname ? this.displayname : this.name
+                                                                        });
+                                                                    } 
+                                                                } else {
+                                                                    items.push({
+                                                                        id: this.id,
+                                                                        description: this.displayname ? this.displayname : this.name
+                                                                    });
+                                                                }                                                                
                                                             });
                                                         }
                                                     });
@@ -1993,7 +2011,7 @@
         }
 
         if (jsonObj.state != "Creating") {
-            if (jsonObj.type == "ROOT") {
+            if (jsonObj.type == "ROOT") {                
                 if (jsonObj.vmstate == "Stopped") {
                     allowedActions.push("createTemplate");
                 }


[06/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6852: UI - add sharedFunction isModuleIncluded().

(cherry picked from commit 431ea8e9c2a09d85b089cd5bf608eb0ab340f083)


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

Branch: refs/heads/4.4
Commit: f7697637cb5e6787d4f8f23ef0d8432f28d8b921
Parents: ebcb5a5
Author: Jessica Wang <je...@apache.org>
Authored: Thu Jun 5 13:44:33 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:25 2014 +0200

----------------------------------------------------------------------
 ui/scripts/sharedFunctions.js | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f7697637/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index d206349..c51bc8d 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -1119,6 +1119,16 @@ cloudStack.converters = {
     }
 }
 
+function isModuleIncluded(moduleName) {    
+    for(var moduleIndex = 0; moduleIndex < cloudStack.modules.length; moduleIndex++) {
+        if (cloudStack.modules[moduleIndex] == moduleName) {
+            return true;            
+            break;            
+        }
+    }    
+    return false;
+}
+
 //data parameter passed to API call in listView
 
 function listViewDataProvider(args, data, options) {


[16/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6879 Tagged the testcase test_vpc_site2site_vpn with the bugId

Signed-off-by: Abhinandan Prateek <ap...@apache.org>
(cherry picked from commit 06846082515e9524fb6c6a28608c8b0d843aab2f)


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

Branch: refs/heads/4.4
Commit: 4dc62bd90eb80a20a4724b40a2c92ac74cd9a68b
Parents: 6c85ff5
Author: Bharat Kumar <bh...@citrix.com>
Authored: Mon Jun 9 18:47:50 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:30 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_vpc_vpn.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4dc62bd9/test/integration/smoke/test_vpc_vpn.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_vpc_vpn.py b/test/integration/smoke/test_vpc_vpn.py
index 0e94e25..d06fd29 100644
--- a/test/integration/smoke/test_vpc_vpn.py
+++ b/test/integration/smoke/test_vpc_vpn.py
@@ -227,7 +227,7 @@ class TestVpcSite2SiteVpn(cloudstackTestCase):
         )
         cls.cleanup = [cls.account]
 
-    @attr(tags=["advanced", "selfservice"])
+    @attr(tags=["advanced", "selfservice"], BugId="CLOUDSTACK-6879")
     def test_vpc_site2site_vpn(self):
         """Test VPN in VPC"""
 


[09/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6852: UI - modules - (1) add new shared function addExtraPropertiesIfDrModuleIncluded(). (2) add DR fields to Instances detailView.

(cherry picked from commit e9ebe6e22e1db5104ed9a0f50de17c14c6b6fc28)


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

Branch: refs/heads/4.4
Commit: 6519a46d2855f8fce3a3f849fb943da9bfee5088
Parents: 8a58bd3
Author: Jessica Wang <je...@apache.org>
Authored: Fri Jun 6 15:15:11 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:27 2014 +0200

----------------------------------------------------------------------
 ui/scripts/instances.js       |  3 +++
 ui/scripts/sharedFunctions.js | 26 ++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6519a46d/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index d219e6d..cda531e 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -1878,6 +1878,9 @@
                                             jsonObj.xenserverToolsVersion61plus = false;
                                     }
                                     
+                                    //if DR module is included                                   
+                                    addExtraPropertiesIfDrModuleIncluded(jsonObj, "UserVM");
+                                                                        
                                     args.response.success({
                                         actionFilter: vmActionfilter,
                                         data: jsonObj

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6519a46d/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 445351a..5672820 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -1175,6 +1175,32 @@ function listViewDataProvider(args, data, options) {
     return data;
 }
 
+var addExtraPropertiesIfDrModuleIncluded = function(jsonObj, resourceType) {      
+    if (drModuleIncluded) {
+        $.ajax({
+            url: createURL("listResourceDetails"),
+            data: {
+                resourceid: jsonObj.id,
+                resourcetype: resourceType
+            },
+            async: false,
+            success: function(json) {    
+                var drFieldNameArray = [];
+                var resourcedetails = json.listresourcedetailsresponse.resourcedetail;
+                if (resourcedetails != undefined) {
+                    for (var i = 0; i < resourcedetails.length; i++) {                                                        
+                        if (resourcedetails[i].key.indexOf("DR_") > -1) {     
+                            drFieldNameArray.push(resourcedetails[i].key);
+                            jsonObj[resourcedetails[i].key] = resourcedetails[i].value;                                                                                                                   
+                        }
+                    }
+                }                  
+                jsonObj["drFieldNameArray"] = drFieldNameArray;
+            }
+        });
+    }    
+}
+
 //used by infrastructure page and network page
 var addExtraPropertiesToGuestNetworkObject = function(jsonObj) {
     jsonObj.networkdomaintext = jsonObj.networkdomain;


[40/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Destroy unplugged VIFs before creating a VIF for a VM, and reuse the device id

(cherry picked from commit d0552a2ab2875c3850cb0f54407c33714160bbf0)


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

Branch: refs/heads/4.4
Commit: 7b1104aa15659fda6caa3649348ee11aad5ee766
Parents: b0c6de6
Author: Anthony Xu <an...@citrix.com>
Authored: Fri Jun 27 14:52:13 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:48 2014 +0200

----------------------------------------------------------------------
 .../src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java   | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7b1104aa/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 9e34b63..5450675 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -3908,7 +3908,6 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                         s_logger.debug("Found unplugged VIF " + deviceId + " in VM " + vmName + " destroy it");
                         vif.destroy(conn);
                     }
-                    usedDeviceNums.add(Integer.valueOf(vif.getDevice(conn)));
                 } catch (NumberFormatException e) {
                     String msg = "Obtained an invalid value for an allocated VIF device number for VM: " + vmName;
                     s_logger.debug(msg, e);


[43/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Polish IPv6 input error information

(cherry picked from commit 09abcf354f395b8d701c8b84b5ed20807f41519a)


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

Branch: refs/heads/4.4
Commit: bb5ba26b60977630a6015e88b4aab2c1d269d0be
Parents: ab85d00
Author: Sheng Yang <sh...@citrix.com>
Authored: Tue Jul 1 15:16:40 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:50 2014 +0200

----------------------------------------------------------------------
 utils/src/com/cloud/utils/net/NetUtils.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bb5ba26b/utils/src/com/cloud/utils/net/NetUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/net/NetUtils.java b/utils/src/com/cloud/utils/net/NetUtils.java
index efb5ae5..aab1437 100755
--- a/utils/src/com/cloud/utils/net/NetUtils.java
+++ b/utils/src/com/cloud/utils/net/NetUtils.java
@@ -1381,11 +1381,19 @@ public class NetUtils {
     }
 
     public static String standardizeIp6Address(String ip6Addr) {
-        return IPv6Address.fromString(ip6Addr).toString();
+        try {
+            return IPv6Address.fromString(ip6Addr).toString();
+        } catch (IllegalArgumentException ex) {
+            throw new IllegalArgumentException("Invalid IPv6 address: " + ex.getMessage());
+        }
     }
 
     public static String standardizeIp6Cidr(String ip6Cidr){
-        return IPv6Network.fromString(ip6Cidr).toString();
+        try {
+            return IPv6Network.fromString(ip6Cidr).toString();
+        } catch (IllegalArgumentException ex) {
+            throw new IllegalArgumentException("Invalid IPv6 CIDR: " + ex.getMessage());
+        }
     }
 
     static final String VLAN_PREFIX = "vlan://";


[02/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Fixed Regression issues mentioned in following test failures

integration.smoke.test_iso - CLOUDSTACK-6774, CLOUDSTACK-6769
integration.smoke.test_non_contigiousvlan - CLOUDSTACK-6776
integration.smoke.test_primary_storage - CLOUDSTACK-6770
integration.smoke.test_secondary_storage – CLOUDSTACK-6777, CLOUDSTACK-6773
integration.smoke.test_scale_vm - CLOUDSTACK-6768

Signed-off-by: Abhinandan Prateek <ap...@apache.org>
(cherry picked from commit 2a28a3c5a4dc006cf8f158dfefa67a331f504c4a)


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

Branch: refs/heads/4.4
Commit: 360e5a2770ab63170a46dfc79f60b4f5485e8670
Parents: 794e8a6
Author: Harikrishna Patnala <ha...@citrix.com>
Authored: Tue May 27 15:46:51 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:22 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_iso.py                | 2 +-
 test/integration/smoke/test_non_contigiousvlan.py | 2 +-
 test/integration/smoke/test_primary_storage.py    | 4 ++--
 test/integration/smoke/test_scale_vm.py           | 2 +-
 test/integration/smoke/test_secondary_storage.py  | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/360e5a27/test/integration/smoke/test_iso.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py
index 5312d71..1cb9058 100644
--- a/test/integration/smoke/test_iso.py
+++ b/test/integration/smoke/test_iso.py
@@ -126,7 +126,7 @@ class TestCreateIso(cloudstackTestCase):
 
         return
 
-    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"])
+    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774")
     def test_01_create_iso(self):
         """Test create public & private ISO
         """

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/360e5a27/test/integration/smoke/test_non_contigiousvlan.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_non_contigiousvlan.py b/test/integration/smoke/test_non_contigiousvlan.py
index 2f23add..d21391e 100644
--- a/test/integration/smoke/test_non_contigiousvlan.py
+++ b/test/integration/smoke/test_non_contigiousvlan.py
@@ -32,7 +32,7 @@ class Services():
         }
 
 
-@attr(tags = ["simulator", "advanced", "selfservice"])
+@attr(tags = ["simulator", "advanced", "selfservice"], BugId="CLOUDSTACK-6776")
 class TestUpdatePhysicalNetwork(cloudstackTestCase):
     """
     Test to extend physical network vlan range

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/360e5a27/test/integration/smoke/test_primary_storage.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_primary_storage.py b/test/integration/smoke/test_primary_storage.py
index 7113966..f102078 100644
--- a/test/integration/smoke/test_primary_storage.py
+++ b/test/integration/smoke/test_primary_storage.py
@@ -70,7 +70,7 @@ class TestPrimaryStorageServices(cloudstackTestCase):
             raise Exception("Warning: Exception during cleanup : %s" % e)
         return
 
-    @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"])
+    @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"], BugId="CLOUDSTACK-6770")
     def test_01_primary_storage_nfs(self):
         """Test primary storage pools - XEN, KVM, VMWare
         """
@@ -163,7 +163,7 @@ class TestPrimaryStorageServices(cloudstackTestCase):
             return
 
 
-    @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"])
+    @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"], BugId="CLOUDSTACK-6770")
     def test_01_primary_storage_iscsi(self):
         """Test primary storage pools - XEN, KVM, VMWare
         """

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/360e5a27/test/integration/smoke/test_scale_vm.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_scale_vm.py b/test/integration/smoke/test_scale_vm.py
index 8b73efe..026ac13 100644
--- a/test/integration/smoke/test_scale_vm.py
+++ b/test/integration/smoke/test_scale_vm.py
@@ -159,7 +159,7 @@ class TestScaleVm(cloudstackTestCase):
         return
 
     @attr(hypervisor="xenserver")
-    @attr(tags=["advanced", "basic", "provisioning"])
+    @attr(tags=["advanced", "basic", "provisioning"], BugId="CLOUDSTACK-6768")
     def test_01_scale_vm(self):
         """Test scale virtual machine 
         """

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/360e5a27/test/integration/smoke/test_secondary_storage.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_secondary_storage.py b/test/integration/smoke/test_secondary_storage.py
index b36b10e..8f1792f 100644
--- a/test/integration/smoke/test_secondary_storage.py
+++ b/test/integration/smoke/test_secondary_storage.py
@@ -160,7 +160,7 @@ class TestSecStorageServices(cloudstackTestCase):
                         )
         return
 
-    @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"])
+    @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"], BugId="CLOUDSTACK-6773, CLOUDSTACK-6777")
     def test_02_sys_template_ready(self):
         """Test system templates are ready
         """


[33/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6940:Templates cannot be downloaded from URLs without
matching file extensions.

(cherry picked from commit 008162a75770b83f6249be153f42fd753bdacde5)


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

Branch: refs/heads/4.4
Commit: 30b22ae275f23f018a104d932d4984f74db055d0
Parents: 15ffec2
Author: Min Chen <mi...@citrix.com>
Authored: Wed Jun 18 15:47:57 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:41 2014 +0200

----------------------------------------------------------------------
 .../cloud/template/HypervisorTemplateAdapter.java   | 16 ----------------
 1 file changed, 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/30b22ae2/server/src/com/cloud/template/HypervisorTemplateAdapter.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/HypervisorTemplateAdapter.java b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
index 51dedf7..20309d6 100755
--- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java
+++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
@@ -16,8 +16,6 @@
 // under the License.
 package com.cloud.template;
 
-import java.net.MalformedURLException;
-import java.net.URL;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
@@ -130,20 +128,6 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
     public TemplateProfile prepare(RegisterTemplateCmd cmd) throws ResourceAllocationException {
         TemplateProfile profile = super.prepare(cmd);
         String url = profile.getUrl();
-        String path = null;
-        try {
-            URL str = new URL(url);
-            path = str.getPath();
-        } catch (MalformedURLException ex) {
-            throw new InvalidParameterValueException("Please specify a valid URL. URL:" + url + " is invalid");
-        }
-
-        try {
-            checkFormat(cmd.getFormat(), url);
-        } catch (InvalidParameterValueException ex) {
-            checkFormat(cmd.getFormat(), path);
-        }
-
         UriUtils.validateUrl(url);
         profile.setUrl(url);
         // Check that the resource limit for secondary storage won't be exceeded


[25/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6852: UI - modules - remove variable drModuleIncluded.

(cherry picked from commit 508a966aa1eb2d251cbf2f5374c3f5111e8541cd)


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

Branch: refs/heads/4.4
Commit: 390f0fb68dd930ec8498e502801d6655900685f2
Parents: 31ed30a
Author: Jessica Wang <je...@apache.org>
Authored: Fri Jun 13 15:11:05 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:34 2014 +0200

----------------------------------------------------------------------
 ui/scripts/cloudStack.js      | 5 +----
 ui/scripts/sharedFunctions.js | 4 +---
 ui/scripts/storage.js         | 4 ++--
 3 files changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/390f0fb6/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index ad53a4a..2285276 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -489,9 +489,6 @@
             };
         }
 
-        document.title = _l('label.app.name');
-               
-        // set value to global variable
-        drModuleIncluded = isModuleIncluded("dr");     
+        document.title = _l('label.app.name');            
     });
 })(cloudStack, jQuery);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/390f0fb6/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 5672820..d79c6f5 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -49,8 +49,6 @@ var md5HashedLogin = false;
 var pageSize = 20;
 //var pageSize = 1; //for testing only
 
-var drModuleIncluded = false;
-
 //async action
 var pollAsyncJobResult = function(args) {
     $.ajax({
@@ -1176,7 +1174,7 @@ function listViewDataProvider(args, data, options) {
 }
 
 var addExtraPropertiesIfDrModuleIncluded = function(jsonObj, resourceType) {      
-    if (drModuleIncluded) {
+    if (isModuleIncluded("dr")) {
         $.ajax({
             url: createURL("listResourceDetails"),
             data: {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/390f0fb6/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 0a2d1dc..197ad71 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -906,7 +906,7 @@
                                                 }
                                                                                               
                                                 var volumeDrEnabled = false;                                               
-                                                if (drModuleIncluded) {
+                                                if (isModuleIncluded("dr")) {
                                                     volumeDrEnabled = cloudStack.dr.sharedFunctions.isVolumeDrEnabled(args.context.volumes[0]);                                                    
                                                 }   
                                                 
@@ -920,7 +920,7 @@
                                                         success: function(json) {
                                                             var instanceObjs = json.listvirtualmachinesresponse.virtualmachine;
                                                             $(instanceObjs).each(function() {                                                               
-                                                                if (drModuleIncluded) {
+                                                                if (isModuleIncluded("dr")) {
                                                                     var vmDrEnabled = cloudStack.dr.sharedFunctions.isVmDrEnabled(this);
                                                                     if (vmDrEnabled == volumeDrEnabled) {
                                                                         items.push({


[03/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6782: Egress FW rules test cases - Format unicode to string before string matching

(cherry picked from commit 323de6823deda16ddafab5d79f18996c70130e2b)


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

Branch: refs/heads/4.4
Commit: ae837e34c6fb2029b2e3840e912330dcc3ecb4cf
Parents: c6a6b5b
Author: Gaurav Aradhye <ga...@clogeny.com>
Authored: Tue May 27 05:51:01 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:23 2014 +0200

----------------------------------------------------------------------
 test/integration/component/test_egress_fw_rules.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ae837e34/test/integration/component/test_egress_fw_rules.py
----------------------------------------------------------------------
diff --git a/test/integration/component/test_egress_fw_rules.py b/test/integration/component/test_egress_fw_rules.py
index 8da3738..6060115 100644
--- a/test/integration/component/test_egress_fw_rules.py
+++ b/test/integration/component/test_egress_fw_rules.py
@@ -274,7 +274,10 @@ class TestEgressFWRules(cloudstackTestCase):
             self.debug("script: %s" % script+exec_cmd_params)
             self.debug("result: %s" % result)
 
-            str_result = str(str(result).strip())
+            if isinstance(result, list):
+                str_result = str([str(x) for x in result])
+            else:
+                str_result = str(result)
             str_expected_result = str(expected_result).strip()
             if str_result == str_expected_result:
                 exec_success = True


[26/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
UI - modules - replace addExtraPropertiesIfDrModuleIncluded() with cloudStack.dr.sharedFunctions.addExtraProperties().

(cherry picked from commit 497042508ab682eb4a45f0e71b301f588545ee17)


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

Branch: refs/heads/4.4
Commit: b85efa67657312f973b763e8032e5318a2e45b98
Parents: 390f0fb
Author: Jessica Wang <je...@apache.org>
Authored: Fri Jun 13 16:35:29 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:35 2014 +0200

----------------------------------------------------------------------
 ui/scripts/instances.js       |  7 ++++---
 ui/scripts/network.js         |  9 +++++----
 ui/scripts/sharedFunctions.js | 26 --------------------------
 ui/scripts/storage.js         |  5 +++--
 ui/scripts/system.js          | 14 ++++++++------
 5 files changed, 20 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b85efa67/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index cda531e..93a40fc 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -1877,9 +1877,10 @@
                                         else
                                             jsonObj.xenserverToolsVersion61plus = false;
                                     }
-                                    
-                                    //if DR module is included                                   
-                                    addExtraPropertiesIfDrModuleIncluded(jsonObj, "UserVM");
+                                                                       
+                                    if (isModuleIncluded("dr")) {
+                                        cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "UserVM");
+                                    }                                    
                                                                         
                                     args.response.success({
                                         actionFilter: vmActionfilter,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b85efa67/ui/scripts/network.js
----------------------------------------------------------------------
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 1e0dc3c..c0a9205 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -1383,10 +1383,11 @@
                                         success: function(json) {
                                             var jsonObj = json.listnetworksresponse.network[0];
                                             addExtraPropertiesToGuestNetworkObject(jsonObj);
-                                                                                        
-                                            //if DR module is included                                   
-                                            addExtraPropertiesIfDrModuleIncluded(jsonObj, "Network");                                                            
-                                                                                        
+                                             
+                                            if (isModuleIncluded("dr")) {
+                                                cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "Network"); 
+                                            }
+                                                                                     
                                             args.response.success({
                                                 actionFilter: cloudStack.actionFilter.guestNetwork,
                                                 data: jsonObj

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b85efa67/ui/scripts/sharedFunctions.js
----------------------------------------------------------------------
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index d79c6f5..f58fdd2 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -1173,32 +1173,6 @@ function listViewDataProvider(args, data, options) {
     return data;
 }
 
-var addExtraPropertiesIfDrModuleIncluded = function(jsonObj, resourceType) {      
-    if (isModuleIncluded("dr")) {
-        $.ajax({
-            url: createURL("listResourceDetails"),
-            data: {
-                resourceid: jsonObj.id,
-                resourcetype: resourceType
-            },
-            async: false,
-            success: function(json) {    
-                var drFieldNameArray = [];
-                var resourcedetails = json.listresourcedetailsresponse.resourcedetail;
-                if (resourcedetails != undefined) {
-                    for (var i = 0; i < resourcedetails.length; i++) {                                                        
-                        if (resourcedetails[i].key.indexOf("DR_") > -1) {     
-                            drFieldNameArray.push(resourcedetails[i].key);
-                            jsonObj[resourcedetails[i].key] = resourcedetails[i].value;                                                                                                                   
-                        }
-                    }
-                }                  
-                jsonObj["drFieldNameArray"] = drFieldNameArray;
-            }
-        });
-    }    
-}
-
 //used by infrastructure page and network page
 var addExtraPropertiesToGuestNetworkObject = function(jsonObj) {
     jsonObj.networkdomaintext = jsonObj.networkdomain;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b85efa67/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 197ad71..260f521 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -1499,8 +1499,9 @@
                                         success: function(json) {
                                             var jsonObj = json.listvolumesresponse.volume[0];
                                             
-                                            //if DR module is included                                   
-                                            addExtraPropertiesIfDrModuleIncluded(jsonObj, "Volume");
+                                            if (isModuleIncluded("dr")) {
+                                                cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "Volume");
+                                            }                                            
                                             
                                             args.response.success({
                                                 actionFilter: volumeActionfilter,

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b85efa67/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index f2fda08..a366754 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -1954,9 +1954,10 @@
                                                         success: function (json) {
                                                             selectedGuestNetworkObj = json.listnetworksresponse.network[0];
                                                             addExtraPropertiesToGuestNetworkObject(selectedGuestNetworkObj);
-                                                                                                                        
-                                                            //if DR module is included                                   
-                                                            addExtraPropertiesIfDrModuleIncluded(selectedGuestNetworkObj, "Network");                                                            
+                                                                                                           
+                                                            if (isModuleIncluded("dr")) {
+                                                                cloudStack.dr.sharedFunctions.addExtraProperties(selectedGuestNetworkObj, "Network");  
+                                                            }
                                                             
                                                             args.response.success({
                                                                 actionFilter: cloudStack.actionFilter.guestNetwork,
@@ -7594,9 +7595,10 @@
                                                         }
                                                         //override default error handling: cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)});
                                                     });
-                                                    
-                                                    //if DR module is included                                   
-                                                    addExtraPropertiesIfDrModuleIncluded(selectedZoneObj, "Zone");
+                                                                                                       
+                                                    if (isModuleIncluded("dr")) {
+                                                        cloudStack.dr.sharedFunctions.addExtraProperties(selectedZoneObj, "Zone");
+                                                    }
                                                     
                                                     args.response.success({
                                                         actionFilter: zoneActionfilter,


[23/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6907: lisVolumes - make a decision whether to set service or disk offering in the response, based on the DiskOfferingVO type entry, not the volume Type

(cherry picked from commit 43e479d238649e3ab61259b6b57e56152f1ecb29)


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

Branch: refs/heads/4.4
Commit: 31ed30af563c9c98991fd1d8f5e469fc4ea557da
Parents: 7135728
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Thu Jun 12 16:14:31 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:33 2014 +0200

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiDBUtils.java        |  6 +++++-
 .../cloud/api/query/dao/VolumeJoinDaoImpl.java  | 20 ++++++++++++++------
 2 files changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/31ed30af/server/src/com/cloud/api/ApiDBUtils.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java
index 153d998..90a09a0 100755
--- a/server/src/com/cloud/api/ApiDBUtils.java
+++ b/server/src/com/cloud/api/ApiDBUtils.java
@@ -900,7 +900,11 @@ public class ApiDBUtils {
     }
 
     public static DiskOfferingVO findDiskOfferingById(Long diskOfferingId) {
-        return s_diskOfferingDao.findByIdIncludingRemoved(diskOfferingId);
+        DiskOfferingVO off = s_diskOfferingDao.findByIdIncludingRemoved(diskOfferingId);
+        if (off.getType() == DiskOfferingVO.Type.Disk) {
+            return off;
+        }
+        return null;
     }
 
     public static DomainVO findDomainById(Long domainId) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/31ed30af/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
index 9e1ee37..24d0922 100644
--- a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java
@@ -22,13 +22,12 @@ import java.util.List;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.api.ResponseObject.ResponseView;
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.api.ApiDBUtils;
 import com.cloud.api.ApiResponseHelper;
@@ -152,19 +151,28 @@ public class VolumeJoinDaoImpl extends GenericDaoBase<VolumeJoinVO, Long> implem
         // DiskOfferingVO diskOffering =
         // ApiDBUtils.findDiskOfferingById(volume.getDiskOfferingId());
         if (volume.getDiskOfferingId() > 0) {
+            boolean isServiceOffering = false;
             if (volume.getVolumeType().equals(Volume.Type.ROOT)) {
-                volResponse.setServiceOfferingId(volume.getDiskOfferingUuid());
+                isServiceOffering = true;
             } else {
-                volResponse.setDiskOfferingId(volume.getDiskOfferingUuid());
+                // can't rely on the fact that the volume is the datadisk as it might have been created as a root, and
+                // then detached later
+                long offeringId = volume.getDiskOfferingId();
+                if (ApiDBUtils.findDiskOfferingById(offeringId) == null) {
+                    isServiceOffering = true;
+                }
             }
 
-            if (volume.getVolumeType().equals(Volume.Type.ROOT)) {
+            if (isServiceOffering) {
+                volResponse.setServiceOfferingId(volume.getDiskOfferingUuid());
                 volResponse.setServiceOfferingName(volume.getDiskOfferingName());
                 volResponse.setServiceOfferingDisplayText(volume.getDiskOfferingDisplayText());
             } else {
+                volResponse.setDiskOfferingId(volume.getDiskOfferingUuid());
                 volResponse.setDiskOfferingName(volume.getDiskOfferingName());
                 volResponse.setDiskOfferingDisplayText(volume.getDiskOfferingDisplayText());
             }
+
             volResponse.setStorageType(volume.isUseLocalStorage() ? ServiceOffering.StorageType.local.toString() : ServiceOffering.StorageType.shared.toString());
             volResponse.setBytesReadRate(volume.getBytesReadRate());
             volResponse.setBytesWriteRate(volume.getBytesReadRate());


[27/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6919: don't attempt to restart user vms having no Root volume attached

(cherry picked from commit 146867eb071bae6334bb7b902a4c9319c33b5a1f)


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

Branch: refs/heads/4.4
Commit: 388af6c3491a28859c1f66e88e349de889bd23db
Parents: b85efa6
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Mon Jun 16 14:57:02 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:36 2014 +0200

----------------------------------------------------------------------
 .../cloud/storage/StoragePoolAutomationImpl.java | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/388af6c3/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StoragePoolAutomationImpl.java b/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
index 8becd75..8ff759d 100644
--- a/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
+++ b/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
@@ -23,15 +23,14 @@ import java.util.List;
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -362,10 +361,16 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation {
                 // if the instance is of type user vm, call the user vm manager
                 if (vmInstance.getType().equals(VirtualMachine.Type.User)) {
                     UserVmVO userVm = userVmDao.findById(vmInstance.getId());
-
-                    vmMgr.advanceStart(userVm.getUuid(), null, null);                        // update work queue
-                    work.setStartedAfterMaintenance(true);
-                    _storagePoolWorkDao.update(work.getId(), work);
+                    // check if the vm has a root volume. If not, remove the item from the queue, the vm should be
+                    // started only when it has at least one root volume attached to it
+                    // don't allow to start vm that doesn't have a root volume
+                    if (volumeDao.findByInstanceAndType(work.getId(), Volume.Type.ROOT).isEmpty()) {
+                        _storagePoolWorkDao.remove(work.getId());
+                    } else {
+                        vmMgr.advanceStart(userVm.getUuid(), null, null);
+                        work.setStartedAfterMaintenance(true);
+                        _storagePoolWorkDao.update(work.getId(), work);
+                    }
                 }
                 return true;
             } catch (Exception e) {


[37/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6989: Add 3 strikes rule for RvR freezing detection

Sometime in VR ntpd would move time backward to keep sync with NTP server, which
can result in false alarm of keepalived monitering process.

This patch adds 3 strikes for keepalived process dead detection to avoid falsely
shutdown keepalived process due to time adjustment for only once.

(cherry picked from commit a6381f5809253c4fe2a2a6ac932a4d8861de8de2)


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

Branch: refs/heads/4.4
Commit: 446899d887c0371be808768abce61c3720897978
Parents: c513d6f
Author: Sheng Yang <sh...@citrix.com>
Authored: Tue Jun 24 16:58:55 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:44 2014 +0200

----------------------------------------------------------------------
 .../root/redundant_router/check_heartbeat.sh.templ   | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/446899d8/systemvm/patches/debian/config/root/redundant_router/check_heartbeat.sh.templ
----------------------------------------------------------------------
diff --git a/systemvm/patches/debian/config/root/redundant_router/check_heartbeat.sh.templ b/systemvm/patches/debian/config/root/redundant_router/check_heartbeat.sh.templ
index 95cabd6b..d6bdc5d 100755
--- a/systemvm/patches/debian/config/root/redundant_router/check_heartbeat.sh.templ
+++ b/systemvm/patches/debian/config/root/redundant_router/check_heartbeat.sh.templ
@@ -17,13 +17,28 @@
 # under the License.
 
 
+STRIKE_FILE="[RROUTER_BIN_PATH]/keepalived.strikes"
+
 if [ -e [RROUTER_BIN_PATH]/keepalived.ts2 ]
 then
     lasttime=$(cat [RROUTER_BIN_PATH]/keepalived.ts2)
     thistime=$(cat [RROUTER_BIN_PATH]/keepalived.ts)
     diff=$(($thistime - $lasttime))
+    s=0
     if [ $diff -lt 30 ]
     then
+        if [ -e $STRIKE_FILE ]
+        then
+            s=`cat $STRIKE_FILE 2>/dev/null`
+        fi
+        s=$(($s+1))
+        echo $s > $STRIKE_FILE
+    else
+        rm $STRIKE_FILE
+    fi
+    #3 strikes rule
+    if [ $s -gt 2 ]
+    then
         echo Keepalived process is dead! >> [RROUTER_LOG]
         [RROUTER_BIN_PATH]/services.sh stop >> [RROUTER_LOG] 2>&1
         [RROUTER_BIN_PATH]/disable_pubip.sh >> [RROUTER_LOG] 2>&1


[07/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6769 Test case failure in test_iso.py Disableing all the tests in this suite untill issues mentioned in the above ticket are resolved.

Signed-off-by: Abhinandan Prateek <ap...@apache.org>
(cherry picked from commit b4cb969d9b8162fc588f2e2923f64acf9dc1e487)


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

Branch: refs/heads/4.4
Commit: ebcb5a5514b7ddada95dfae75d11e3af01bf0fa7
Parents: 90c50f0
Author: Bharat Kumar <bh...@citrix.com>
Authored: Wed Jun 4 18:52:36 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:25 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_iso.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ebcb5a55/test/integration/smoke/test_iso.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py
index 9887af0..01ce2fd 100644
--- a/test/integration/smoke/test_iso.py
+++ b/test/integration/smoke/test_iso.py
@@ -281,7 +281,7 @@ class TestISO(cloudstackTestCase):
 
         return
 
-    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"])
+    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"],BugId="CLOUDSTACK-6769, CLOUDSTACK-6774")
     def test_02_edit_iso(self):
         """Test Edit ISO
         """
@@ -346,7 +346,7 @@ class TestISO(cloudstackTestCase):
                         )
         return
 
-    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"])
+    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774")
     def test_03_delete_iso(self):
         """Test delete ISO
         """
@@ -374,7 +374,7 @@ class TestISO(cloudstackTestCase):
                          )
         return
 
-    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "provisioning"])
+    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "provisioning"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774")
     def test_04_extract_Iso(self):
         "Test for extract ISO"
 
@@ -425,7 +425,7 @@ class TestISO(cloudstackTestCase):
                          )
         return
 
-    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"])
+    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774")
     def test_05_iso_permissions(self):
         """Update & Test for ISO permissions"""
 
@@ -477,7 +477,7 @@ class TestISO(cloudstackTestCase):
                         )
         return
 
-    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "multizone", "provisioning"])
+    @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "multizone", "provisioning"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774")
     def test_06_copy_iso(self):
         """Test for copy ISO from one zone to another"""
 


[24/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Fixed few coverity issues unused assignments, boxing and unboxing of values etc.

Signed-off-by: Koushik Das <ko...@apache.org>
(cherry picked from commit 32a7d5d387804374c38ed568e2dcd1e9c543873c)


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

Branch: refs/heads/4.4
Commit: 713572887c58e790515e5f0bc714c2baa0d1fa29
Parents: 9a76b75
Author: Rajani Karuturi <ra...@gmail.com>
Authored: Wed Jun 11 14:36:06 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:33 2014 +0200

----------------------------------------------------------------------
 .../cloud/configuration/ConfigurationManagerImpl.java   | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/71357288/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index d2f5af3..010ca7a 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -954,9 +954,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
         }
 
         // Check if the IP range is valid
-        if (startIp != null || endIp != null) {
-            checkIpRange(startIp, endIp, cidrAddress, cidrSize);
-        }
+        checkIpRange(startIp, endIp, cidrAddress, cidrSize);
 
         // Check if the IP range overlaps with the public ip
         checkOverlapPublicIpRange(zoneId, startIp, endIp);
@@ -1016,7 +1014,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
             @Override
             public void doInTransactionWithoutResult(TransactionStatus status) {
         // Delete private ip addresses for the pod if there are any
-                List<DataCenterIpAddressVO> privateIps = _privateIpAddressDao.listByPodIdDcId(Long.valueOf(podId), pod.getDataCenterId());
+                List<DataCenterIpAddressVO> privateIps = _privateIpAddressDao.listByPodIdDcId(podId, pod.getDataCenterId());
         if (!privateIps.isEmpty()) {
             if (!(_privateIpAddressDao.deleteIpAddressByPod(podId))) {
                 throw new CloudRuntimeException("Failed to cleanup private ip addresses for pod " + podId);
@@ -1517,13 +1515,8 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
     @ActionEvent(eventType = EventTypes.EVENT_ZONE_DELETE, eventDescription = "deleting zone", async = false)
     public boolean deleteZone(DeleteZoneCmd cmd) {
 
-        Long userId = CallContext.current().getCallingUserId();
         final Long zoneId = cmd.getId();
 
-        if (userId == null) {
-            userId = Long.valueOf(User.UID_SYSTEM);
-        }
-
         // Make sure the zone exists
         if (!validZone(zoneId)) {
             throw new InvalidParameterValueException("A zone with ID: " + zoneId + " does not exist.");
@@ -2044,7 +2037,6 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
             }
         } else {
             allowNetworkRate = true;
-            ;
         }
 
         if (cmd.getNetworkRate() != null && !allowNetworkRate) {


[05/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6805: UI > create account > fix a bug that account creation failed when password contains # character.

(cherry picked from commit 76c71c7bc1fc0368e7d86c63107e269f34787c23)


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

Branch: refs/heads/4.4
Commit: 90c50f0fa033d0f69ad78ecfd3186ca9c4bc07dc
Parents: ae837e3
Author: Jessica Wang <je...@apache.org>
Authored: Thu May 29 11:52:42 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:24 2014 +0200

----------------------------------------------------------------------
 ui/scripts/accountsWizard.js | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/90c50f0f/ui/scripts/accountsWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/accountsWizard.js b/ui/scripts/accountsWizard.js
index e02a04e..f022193 100644
--- a/ui/scripts/accountsWizard.js
+++ b/ui/scripts/accountsWizard.js
@@ -182,6 +182,8 @@
                 password = args.data.password;
                 if (md5Hashed) {
                     password = $.md5(password);
+                } else {
+                	password = todb(password);
                 }
                 array1.push("&password=" + password);
             }
@@ -218,6 +220,7 @@
                     $.ajax({
                         url: createURL('importLdapUsers' + array1.join("")),
                         dataType: "json",
+                        type: "POST",
                         async: false,
                         success: function(json) {
                             var count = json.ldapuserresponse.count;
@@ -233,6 +236,7 @@
                     $.ajax({
                         url: createURL('ldapCreateAccount' + array1.join("")),
                         dataType: "json",
+                        type: "POST",
                         async: false,
                         success: function(json) {
                             var item = json.createaccountresponse.account;
@@ -249,6 +253,7 @@
                 $.ajax({
                     url: createURL('createAccount' + array1.join("")),
                     dataType: "json",
+                    type: "POST",
                     async: false,
                     success: function(json) {
                         var item = json.createaccountresponse.account;


[41/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-4364: Restore VM - log a usage event for newly created volume

(cherry picked from commit 1e7835488222471a565174ee1fdf8bb985fc9024)


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

Branch: refs/heads/4.4
Commit: fec9ccf446357c5969a33dc9bff5947b9011c1d5
Parents: 794ef20
Author: Nitin Mehta <ni...@citrix.com>
Authored: Mon Jun 30 14:36:57 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:49 2014 +0200

----------------------------------------------------------------------
 server/src/com/cloud/vm/UserVmManagerImpl.java  | 5 ++++-
 server/test/com/cloud/vm/UserVmManagerTest.java | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fec9ccf4/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 4f0c5f4..3b91688 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -4670,10 +4670,13 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
         } else {
             newVol = volumeMgr.allocateDuplicateVolume(root, null);
         }
-        // Save usage event and update resource count for user vm volumes
+        // 1. Save usage event and update resource count for user vm volumes
         if (vm instanceof UserVm) {
             _resourceLimitMgr.incrementResourceCount(vm.getAccountId(), ResourceType.volume);
         }
+        //2. Create Usage event for the newly created volume
+        UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VOLUME_CREATE, newVol.getAccountId(), newVol.getDataCenterId(), newVol.getId(), newVol.getName(), newVol.getDiskOfferingId(), templateId, newVol.getSize());
+        _usageEventDao.persist(usageEvent);
 
         handleManagedStorage(vm, root);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fec9ccf4/server/test/com/cloud/vm/UserVmManagerTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/UserVmManagerTest.java b/server/test/com/cloud/vm/UserVmManagerTest.java
index b67c164..21cebb5 100755
--- a/server/test/com/cloud/vm/UserVmManagerTest.java
+++ b/server/test/com/cloud/vm/UserVmManagerTest.java
@@ -35,6 +35,7 @@ import java.lang.reflect.Field;
 import java.util.List;
 import java.util.UUID;
 
+import com.cloud.event.dao.UsageEventDao;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mock;
@@ -145,6 +146,8 @@ public class UserVmManagerTest {
     ResourceLimitService _resourceLimitMgr;
     @Mock
     PrimaryDataStoreDao _storagePoolDao;
+    @Mock
+    UsageEventDao _usageEventDao;
 
     @Before
     public void setup() {
@@ -154,6 +157,7 @@ public class UserVmManagerTest {
         _userVmMgr._vmInstanceDao = _vmInstanceDao;
         _userVmMgr._templateDao = _templateDao;
         _userVmMgr._volsDao = _volsDao;
+        _userVmMgr._usageEventDao = _usageEventDao;
         _userVmMgr._itMgr = _itMgr;
         _userVmMgr.volumeMgr = _storageMgr;
         _userVmMgr._accountDao = _accountDao;


[32/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6941: Can't choose storage for the volume, when attaching uploaded data volume to VM

Changes:
- Only way to choose a certain storage pool is by using disk_offering_tags
- Added a parameter to take in a disk offering Id.
- Admin will have to create a custom sized disk offering and tag it as necessary for the user
- This custom offering Id should be passed during uploadVolume to associate the volume with this disk offering

(cherry picked from commit 13bd8beb914ae11d45630b2aa34e15889aff91da)


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

Branch: refs/heads/4.4
Commit: 20a457dd6ed31cbc8f9a6babdda5b545510dbef0
Parents: 30b22ae
Author: Prachi Damle <pr...@cloud.com>
Authored: Wed Jun 18 16:09:51 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:41 2014 +0200

----------------------------------------------------------------------
 .../command/user/volume/UploadVolumeCmd.java    |  8 ++++
 .../com/cloud/storage/VolumeApiServiceImpl.java | 44 ++++++++++++++++----
 2 files changed, 44 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20a457dd/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
index 7a08abf..c360c14 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
@@ -25,6 +25,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ResponseObject.ResponseView;
 import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
 import org.apache.cloudstack.api.response.DomainResponse;
 import org.apache.cloudstack.api.response.ProjectResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
@@ -89,6 +90,9 @@ public class UploadVolumeCmd extends BaseAsyncCmd {
     @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "Upload volume for the project")
     private Long projectId;
 
+    @Parameter(name = ApiConstants.DISK_OFFERING_ID, required = false, type = CommandType.UUID, entityType = DiskOfferingResponse.class, description = "the ID of the disk offering. This must be a custom sized offering since during uploadVolume volume size is unknown.")
+    private Long diskOfferingId;
+
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
@@ -125,6 +129,10 @@ public class UploadVolumeCmd extends BaseAsyncCmd {
         return imageStoreUuid;
     }
 
+    public Long getDiskOfferingId() {
+        return diskOfferingId;
+    }
+
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20a457dd/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index fd434a5..5c517f4 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -254,12 +254,13 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
         String volumeName = cmd.getVolumeName();
         String url = cmd.getUrl();
         String format = cmd.getFormat();
+        Long diskOfferingId = cmd.getDiskOfferingId();
         String imageStoreUuid = cmd.getImageStoreUuid();
         DataStore store = _tmpltMgr.getImageStore(imageStoreUuid, zoneId);
 
-        validateVolume(caller, ownerId, zoneId, volumeName, url, format);
+        validateVolume(caller, ownerId, zoneId, volumeName, url, format, diskOfferingId);
 
-        VolumeVO volume = persistVolume(owner, zoneId, volumeName, url, cmd.getFormat());
+        VolumeVO volume = persistVolume(owner, zoneId, volumeName, url, cmd.getFormat(), diskOfferingId);
 
         VolumeInfo vol = volFactory.getVolume(volume.getId());
 
@@ -270,13 +271,15 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
         return volume;
     }
 
-    private boolean validateVolume(Account caller, long ownerId, Long zoneId, String volumeName, String url, String format) throws ResourceAllocationException {
+    private boolean validateVolume(Account caller, long ownerId, Long zoneId, String volumeName, String url,
+            String format, Long diskOfferingId) throws ResourceAllocationException {
 
         // permission check
-        _accountMgr.checkAccess(caller, null, true, _accountMgr.getActiveAccountById(ownerId));
+        Account volumeOwner = _accountMgr.getActiveAccountById(ownerId);
+        _accountMgr.checkAccess(caller, null, true, volumeOwner);
 
         // Check that the resource limit for volumes won't be exceeded
-        _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId), ResourceType.volume);
+        _resourceLimitMgr.checkResourceLimit(volumeOwner, ResourceType.volume);
 
         // Verify that zone exists
         DataCenterVO zone = _dcDao.findById(zoneId);
@@ -323,9 +326,28 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
         }
         UriUtils.validateUrl(url);
 
+
         // Check that the resource limit for secondary storage won't be exceeded
         _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId), ResourceType.secondary_storage, UriUtils.getRemoteSize(url));
 
+        // Check that the the disk offering specified is valid
+        if (diskOfferingId != null) {
+            DiskOfferingVO diskOffering = _diskOfferingDao.findById(diskOfferingId);
+            if ((diskOffering == null) || diskOffering.getRemoved() != null
+                    || !DiskOfferingVO.Type.Disk.equals(diskOffering.getType())) {
+                throw new InvalidParameterValueException("Please specify a valid disk offering.");
+            }
+            if (!diskOffering.isCustomized()) {
+                throw new InvalidParameterValueException("Please specify a custom sized disk offering.");
+            }
+
+            if (diskOffering.getDomainId() == null) {
+                // do nothing as offering is public
+            } else {
+                _configMgr.checkDiskOfferingAccess(volumeOwner, diskOffering);
+            }
+        }
+
         return false;
     }
 
@@ -334,7 +356,8 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
     }
 
     @DB
-    protected VolumeVO persistVolume(final Account owner, final Long zoneId, final String volumeName, final String url, final String format) {
+    protected VolumeVO persistVolume(final Account owner, final Long zoneId, final String volumeName, final String url,
+            final String format, final Long diskOfferingId) {
         return Transaction.execute(new TransactionCallback<VolumeVO>() {
             @Override
             public VolumeVO doInTransaction(TransactionStatus status) {
@@ -346,8 +369,13 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
                 // TODO Decide if this is valid or whether  throwing a CloudRuntimeException is more appropriate
                 volume.setAccountId((owner == null) ? Account.ACCOUNT_ID_SYSTEM : owner.getAccountId());
                 volume.setDomainId((owner == null) ? Domain.ROOT_DOMAIN : owner.getDomainId());
-        long diskOfferingId = _diskOfferingDao.findByUniqueName("Cloud.com-Custom").getId();
-        volume.setDiskOfferingId(diskOfferingId);
+
+                if (diskOfferingId == null) {
+                    long defaultDiskOfferingId = _diskOfferingDao.findByUniqueName("Cloud.com-Custom").getId();
+                    volume.setDiskOfferingId(defaultDiskOfferingId);
+                } else {
+                    volume.setDiskOfferingId(diskOfferingId);
+                }
         // volume.setSize(size);
         volume.setInstanceId(null);
         volume.setUpdated(new Date());


[19/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6889: UI - create network offering - to reduce API call size, not pass any parameter whose value entered on UI happens to be the same as its default value at server-side.

(cherry picked from commit 81857d0577bbd9a7febef74a224e06516fadc39f)


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

Branch: refs/heads/4.4
Commit: 20c3f1c0ed299bed60f5001bd17f73ed7f2aebbd
Parents: d0e0edc
Author: Jessica Wang <je...@apache.org>
Authored: Wed Jun 11 10:50:14 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:31 2014 +0200

----------------------------------------------------------------------
 ui/scripts/configuration.js | 39 ++++++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/20c3f1c0/ui/scripts/configuration.js
----------------------------------------------------------------------
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index 6a4aa42..f56f4e2 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -2324,9 +2324,9 @@
                                         }
 
                                         if (args.$form.find('.form-item[rel=\"service.Firewall.isEnabled\"] input[type=checkbox]').is(':checked') == true) {
-                                            args.$form.find('.form-item[rel=\"egresspolicy\"]').css('display', 'inline-block');
+                                            args.$form.find('.form-item[rel=\"egressdefaultpolicy\"]').css('display', 'inline-block');
                                         } else {
-                                            args.$form.find('.form-item[rel=\"egresspolicy\"]').css('display', 'none');
+                                            args.$form.find('.form-item[rel=\"egressdefaultpolicy\"]').css('display', 'none');
                                         }
 
                                         //show LB Isolation dropdown only when (1)LB Service is checked (2)Service Provider is Netscaler OR F5
@@ -2749,6 +2749,7 @@
                                     conservemode: {
                                         label: 'label.conserve.mode',
                                         isBoolean: true,
+                                        isChecked: true,
                                         docID: 'helpNetworkOfferingConserveMode'
                                     },
 
@@ -2773,7 +2774,7 @@
                                         }
                                     },
 
-                                    egresspolicy: {
+                                    egressdefaultpolicy: {
                                         label: 'label.default.egress.policy',
                                         isHidden: true,
                                         select: function(args) {
@@ -2848,8 +2849,8 @@
                                             inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = 'internal';
                                             serviceCapabilityIndex++;
                                         } 
-                                    } else if (value != '') { // normal data (serviceData.length ==1), e.g. "name", "displayText", "networkRate", "guestIpType", "lbType" (unwanted), "availability" (unwated when value is "Optional"), "egresspolicy", "state" (unwanted), "status" (unwanted), "allocationstate" (unwanted) 
-                                        if (!(key ==  "lbType"  || (key == "availability" && value == "Optional") || key == "state" || key == "status" || key == "allocationstate")) {
+                                    } else if (value != '') { // normal data (serviceData.length ==1), e.g. "name", "displayText", "networkRate", "guestIpType", "lbType" (unwanted), "availability" (unwated when value is "Optional"), "egressdefaultpolicy", "state" (unwanted), "status" (unwanted), "allocationstate" (unwanted) 
+                                        if (!(key ==  "lbType"  || (key == "availability" && value == "Optional") || key == "state" || key == "status" || key == "allocationstate" || key == "useVpc" )) {
                                             inputData[key] = value;
                                         }                                        
                                     }
@@ -2898,28 +2899,28 @@
 
                                 if (inputData['guestIpType'] == "Shared") { //specifyVlan checkbox is disabled, so inputData won't include specifyVlan
                                     inputData['specifyVlan'] = true; //hardcode inputData['specifyVlan']
-                                    inputData['specifyIpRanges'] = true;
-                                    inputData['isPersistent'] = false;
+                                    inputData['specifyIpRanges'] = true;                                    
+                                    delete inputData.isPersistent; //if Persistent checkbox is unchecked, do not pass isPersistent parameter to API call since we need to keep API call's size as small as possible (p.s. isPersistent is defaulted as false at server-side)                                          
                                 } else if (inputData['guestIpType'] == "Isolated") { //specifyVlan checkbox is shown
-                                    inputData['specifyIpRanges'] = false;
-
+                                    //inputData['specifyIpRanges'] = false;
+                                    delete inputData.specifyIpRanges; //if specifyIpRanges should be false, do not pass specifyIpRanges parameter to API call since we need to keep API call's size as small as possible (p.s. specifyIpRanges is defaulted as false at server-side)                                          
+                                          
                                     if (inputData['specifyVlan'] == 'on') { //specifyVlan checkbox is checked
                                         inputData['specifyVlan'] = true;
-                                    } else { //specifyVlan checkbox is unchecked
-                                        inputData['specifyVlan'] = false;
-
+                                    } else { //specifyVlan checkbox is unchecked                                        
+                                        delete inputData.specifyVlan; //if specifyVlan checkbox is unchecked, do not pass specifyVlan parameter to API call since we need to keep API call's size as small as possible (p.s. specifyVlan is defaulted as false at server-side)                                        
                                     }
 
                                     if (inputData['isPersistent'] == 'on') { //It is a persistent network
                                         inputData['isPersistent'] = true;
                                     } else { //Isolated Network with Non-persistent network
-                                        inputData['isPersistent'] = false;
+                                        delete inputData.isPersistent; //if Persistent checkbox is unchecked, do not pass isPersistent parameter to API call since we need to keep API call's size as small as possible (p.s. isPersistent is defaulted as false at server-side)                                          
                                     }
                                 }
 
 
                                 if (inputData['conservemode'] == 'on') {
-                                    inputData['conservemode'] = true;
+                                    delete inputData.conservemode; //if ConserveMode checkbox is checked, do not pass conservemode parameter to API call since we need to keep API call's size as small as possible (p.s. conservemode is defaulted as true at server-side)
                                 } else {
                                     inputData['conservemode'] = false;
                                 }
@@ -2932,10 +2933,14 @@
                                     serviceProviderIndex++;
                                 });
                                 
-                                if (args.$form.find('.form-item[rel=egresspolicy]').is(':visible')) {
-                                    inputData['egressdefaultpolicy'] = formData.egresspolicy === 'ALLOW' ? true : false;
+                                if (args.$form.find('.form-item[rel=egressdefaultpolicy]').is(':visible')) {
+                                    if (formData.egressdefaultpolicy === 'ALLOW') {
+                                        delete inputData.egressdefaultpolicy; //do not pass egressdefaultpolicy to API call  since we need to keep API call's size as small as possible (p.s. egressdefaultpolicy is defaulted as true at server-side)
+                                    } else {
+                                        inputData['egressdefaultpolicy'] = false;
+                                    }
                                 } else {
-                                    delete inputData.egresspolicy;
+                                    delete inputData.egressdefaultpolicy;
                                 }
 
                                 if (args.$form.find('.form-item[rel=serviceofferingid]').css("display") == "none")


[30/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6936: UI - (1)dialog widget > dropdown field > provide a blank option if there is no data for option(s) in a dropdown field. (2) Add Primary Storage dialog - cluster dropdown field - still calls args.response.success() when there is no data for option(s).

(cherry picked from commit b8a29615838bd12d0f6699ef3e64bb9b89158c26)


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

Branch: refs/heads/4.4
Commit: e988c917c65504a153a353e6981c2b05c7d9186c
Parents: b56246c
Author: Jessica Wang <je...@apache.org>
Authored: Wed Jun 18 12:20:43 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:40 2014 +0200

----------------------------------------------------------------------
 ui/scripts/system.js    | 10 ++++++----
 ui/scripts/ui/dialog.js |  6 ++++++
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e988c917/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index a366754..e6fb7a6 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -15436,17 +15436,19 @@
                                         dependsOn: 'clusterId',
                                         select: function (args) {
                                             var clusterId = args.clusterId;
-                                            if (clusterId == null)
+                                            if (clusterId == null || clusterId.length == 0) {
+                                            	args.response.success({
+                                                    data: []
+                                                });
                                             return;
-                                            var items =[];
+                                            }
+                                            
                                             $(clusterObjs).each(function () {
                                                 if (this.id == clusterId) {
                                                     selectedClusterObj = this;
                                                     return false; //break the $.each() loop
                                                 }
                                             });
-                                            if (selectedClusterObj == null)
-                                            return;
                                             
                                             if (selectedClusterObj.hypervisortype == "KVM") {
                                                 var items =[];

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e988c917/ui/scripts/ui/dialog.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js
index 7a903fd..0fddcf7 100644
--- a/ui/scripts/ui/dialog.js
+++ b/ui/scripts/ui/dialog.js
@@ -271,6 +271,11 @@
                         context: args.context,
                         response: {
                             success: function(args) {
+                            	if (args.data == undefined || args.data.length == 0) {
+                            		var $option = $('<option>')
+                                    .appendTo($input)                                    
+                                    .html("");
+                            	} else {
                                 $(args.data).each(function() {
                                     var id;
                                     if (field.valueField)
@@ -290,6 +295,7 @@
                                             .data('json-obj', this)
                                             .html(_s(desc));
                                 });
+                            	}
 
                                 if (field.defaultValue) {
                                     $input.val(_s(strOrFunc(field.defaultValue, args.data)));


[17/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6875 Tagged the testcase with the bugId.

Signed-off-by: Abhinandan Prateek <ap...@apache.org>
(cherry picked from commit e58cc98c74c1655f5b5da60f75eeeef8269f800d)


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

Branch: refs/heads/4.4
Commit: 6c85ff5cfa27b06506606765f03086fcf274e767
Parents: 5bbf287
Author: Bharat Kumar <bh...@citrix.com>
Authored: Mon Jun 9 18:39:17 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:30 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_volumes.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c85ff5c/test/integration/smoke/test_volumes.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py
index 227356d..94e5086 100644
--- a/test/integration/smoke/test_volumes.py
+++ b/test/integration/smoke/test_volumes.py
@@ -753,7 +753,7 @@ class TestVolumes(cloudstackTestCase):
             time.sleep(30)
         return
 
-    @attr(tags = ["advanced", "advancedns", "smoke","basic", "selfservice"])
+    @attr(tags = ["advanced", "advancedns", "smoke","basic", "selfservice"], BugId="CLOUDSTACK-6875")
     def test_09_delete_detached_volume(self):
         """Delete a Volume unattached to an VM
         """


[14/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6877 Tagged the testcase with the bugId

Signed-off-by: Abhinandan Prateek <ap...@apache.org>
(cherry picked from commit 06bcc8d9eee802a3f5ada6bb7335ffe0cb7b3008)


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

Branch: refs/heads/4.4
Commit: 3d5a7abba96092db7957f68fae92263213550fc0
Parents: a3e8529
Author: Bharat Kumar <bh...@citrix.com>
Authored: Mon Jun 9 18:42:43 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:29 2014 +0200

----------------------------------------------------------------------
 test/integration/smoke/test_secondary_storage.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3d5a7abb/test/integration/smoke/test_secondary_storage.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_secondary_storage.py b/test/integration/smoke/test_secondary_storage.py
index 8f1792f..43aa859 100644
--- a/test/integration/smoke/test_secondary_storage.py
+++ b/test/integration/smoke/test_secondary_storage.py
@@ -81,7 +81,7 @@ class TestSecStorageServices(cloudstackTestCase):
             raise Exception("Warning: Exception during cleanup : %s" % e)
         return
 
-    @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"])
+    @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"],BugId="CLOUDSTACK-6877")
     def test_01_sys_vm_start(self):
         """Test system VM start
         """


[42/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Some fixes in the simulator
1. Fixed JSON response deserialization. While creating a mock a JSON can be passed which will be deserialized into a response object and returned from agent layer.
For e.g. for a mock corresponding to StopCommand, a response like "{"com.cloud.agent.api.StopAnswer":{"result":false,"wait":0}}" can be passed.
2. Ability to mock PingCommand (returned as part of getCurrentStatus() agent method). As a part of this a mocked VM state report can be returned.
For e.g. {"com.cloud.agent.api.PingRoutingWithNwGroupsCommand":{"newGroupStates":{},"newStates":{},"_hostVmStateReport":{"v-2-VM":{"state":"PowerOn","host":"SimulatedAgent.e6df7732-69b2-429b-9b6a-3e24dddfa2e0"},"i-2-5-VM":{"state":"PowerOff","host":"SimulatedAgent.e6df7732-69b2-429b-9b6a-3e24dddfa2e0"}},"_gatewayAccessible":true,"_vnetAccessible":true,"hostType":"Routing","hostId":3,"contextMap":{},"wait":0}}

(cherry picked from commit 285557fb5f437c43b1a5e58302a3fea6f6e0f865)


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

Branch: refs/heads/4.4
Commit: ab85d00d7cbe15b70a89c4dc2b5bbc81905d1c0e
Parents: fec9ccf
Author: Koushik Das <ko...@apache.org>
Authored: Tue Jul 1 14:54:28 2014 +0530
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:49 2014 +0200

----------------------------------------------------------------------
 .../agent/manager/SimulatorManagerImpl.java     | 18 ++++++---
 .../cloud/resource/AgentRoutingResource.java    | 40 +++++++++++++++++++-
 2 files changed, 51 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ab85d00d/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
index 7114e16..671c2b8 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java
@@ -16,6 +16,7 @@
 // under the License.
 package com.cloud.agent.manager;
 
+import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
@@ -114,6 +115,7 @@ import com.cloud.api.commands.ConfigureSimulatorCmd;
 import com.cloud.api.commands.QuerySimulatorMockCmd;
 import com.cloud.agent.api.SecStorageFirewallCfgCommand;
 import com.cloud.resource.SimulatorStorageProcessor;
+import com.cloud.serializer.GsonHelper;
 import com.cloud.simulator.MockConfigurationVO;
 import com.cloud.simulator.MockHost;
 import com.cloud.simulator.MockVMVO;
@@ -129,11 +131,13 @@ import com.cloud.utils.db.TransactionLegacy;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.vm.VirtualMachine.State;
 import com.google.gson.Gson;
+import com.google.gson.stream.JsonReader;
 
 @Component
 @Local(value = {SimulatorManager.class})
 public class SimulatorManagerImpl extends ManagerBase implements SimulatorManager, PluggableService {
     private static final Logger s_logger = Logger.getLogger(SimulatorManagerImpl.class);
+    private static final Gson s_gson = GsonHelper.getGson();
     @Inject
     MockVmManager _mockVmMgr;
     @Inject
@@ -253,16 +257,20 @@ public class SimulatorManagerImpl extends ManagerBase implements SimulatorManage
                 if (answer == null) {
                     String message = config.getJsonResponse();
                     if (message != null) {
-                        // json response looks like {"<AnswerType>":....}
-                        String answerType = message.split(":")[0].substring(1).replace("\"", "");
-                        if (answerType != null) {
+                        // json response looks like {"<Type>":....}
+                        String objectType = message.split(":")[0].substring(2).replace("\"", "");
+                        String objectData = message.substring(message.indexOf(':') + 1, message.length() - 1);
+                        if (objectType != null) {
                             Class<?> clz = null;
                             try {
-                                clz = Class.forName(answerType);
+                                clz = Class.forName(objectType);
                             } catch (ClassNotFoundException e) {
                             }
                             if (clz != null) {
-                                answer = (Answer)new Gson().fromJson(message, clz);
+                                StringReader reader = new StringReader(objectData);
+                                JsonReader jsonReader = new JsonReader(reader);
+                                jsonReader.setLenient(true);
+                                answer = (Answer)s_gson.fromJson(jsonReader, clz);
                             }
                         }
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ab85d00d/plugins/hypervisors/simulator/src/com/cloud/resource/AgentRoutingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/AgentRoutingResource.java b/plugins/hypervisors/simulator/src/com/cloud/resource/AgentRoutingResource.java
index 4b5c9fd..2d75c6d 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/AgentRoutingResource.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/AgentRoutingResource.java
@@ -16,6 +16,7 @@
 // under the License.
 package com.cloud.resource;
 
+import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -50,6 +51,7 @@ import com.cloud.host.Host;
 import com.cloud.host.Host.Type;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.network.Networks.RouterPrivateIpStrategy;
+import com.cloud.serializer.GsonHelper;
 import com.cloud.simulator.MockConfigurationVO;
 import com.cloud.simulator.MockVMVO;
 import com.cloud.storage.Storage.StorageResourceType;
@@ -58,9 +60,12 @@ import com.cloud.utils.Pair;
 import com.cloud.utils.db.TransactionLegacy;
 import com.cloud.vm.VirtualMachine.PowerState;
 import com.cloud.vm.VirtualMachine.State;
+import com.google.gson.Gson;
+import com.google.gson.stream.JsonReader;
 
 public class AgentRoutingResource extends AgentStorageResource {
     private static final Logger s_logger = Logger.getLogger(AgentRoutingResource.class);
+    private static final Gson s_gson = GsonHelper.getGson();
 
     protected Map<String, State> _vms = new HashMap<String, State>();
     private Map<String, Pair<Long, Long>> _runningVms = new HashMap<String, Pair<Long, Long>>();
@@ -120,6 +125,29 @@ public class AgentRoutingResource extends AgentStorageResource {
                     }
                 }
             }
+
+            config = _simMgr.getMockConfigurationDao().findByNameBottomUP(agentHost.getDataCenterId(), agentHost.getPodId(), agentHost.getClusterId(), agentHost.getId(), "PingRoutingWithNwGroupsCommand");
+            if (config != null) {
+                String message = config.getJsonResponse();
+                if (message != null) {
+                    // json response looks like {"<Type>":....}
+                    String objectType = message.split(":")[0].substring(2).replace("\"", "");
+                    String objectData = message.substring(message.indexOf(':') + 1, message.length() - 1);
+                    if (objectType != null) {
+                        Class<?> clz = null;
+                        try {
+                            clz = Class.forName(objectType);
+                        } catch (ClassNotFoundException e) {
+                        }
+                        if (clz != null) {
+                            StringReader reader = new StringReader(objectData);
+                            JsonReader jsonReader = new JsonReader(reader);
+                            jsonReader.setLenient(true);
+                            return (PingCommand)s_gson.fromJson(jsonReader, clz);
+                        }
+                    }
+                }
+            }
         } catch (Exception e) {
             txn.rollback();
         } finally {
@@ -303,8 +331,16 @@ public class AgentRoutingResource extends AgentStorageResource {
     protected HashMap<String, HostVmStateReportEntry> getHostVmStateReport() {
         HashMap<String, HostVmStateReportEntry> report = new HashMap<String, HostVmStateReportEntry>();
 
-        for (String vmName : _runningVms.keySet()) {
-            report.put(vmName, new HostVmStateReportEntry(PowerState.PowerOn, agentHost.getName()));
+        Map<String, State> states = _simMgr.getVmStates(this.hostGuid);
+        for (String vmName : states.keySet()) {
+            State state = states.get(vmName);
+            if (state == State.Running) {
+                report.put(vmName, new HostVmStateReportEntry(PowerState.PowerOn, agentHost.getName()));
+            } else if (state == State.Stopped) {
+                report.put(vmName, new HostVmStateReportEntry(PowerState.PowerOff, agentHost.getName()));
+            } else {
+                report.put(vmName, new HostVmStateReportEntry(PowerState.PowerUnknown, agentHost.getName()));
+            }
         }
 
         return report;


[39/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
Cs tries to destroy vlan object on XS host when destroying VM, if the VLAN object is being used, CS expects the exception, lower the log level here

(cherry picked from commit 328df6f954332788d1c723922a5dd07107f80240)


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

Branch: refs/heads/4.4
Commit: 794ef207b1ff6a97a1827dacb0651f7a302d1f4e
Parents: 7b1104a
Author: Anthony Xu <an...@citrix.com>
Authored: Fri Jun 27 15:13:57 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:48 2014 +0200

----------------------------------------------------------------------
 .../src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/794ef207/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
index 8031f59..2c272e1 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java
@@ -119,7 +119,7 @@ public class XenServer56Resource extends CitrixResourceBase {
                         host.forgetDataSourceArchives(conn, "pif_" + device + "." + vlannum + "_tx");
                         host.forgetDataSourceArchives(conn, "pif_" + device + "." + vlannum + "_rx");
                     } catch (XenAPIException e) {
-                        s_logger.info("Catch " + e.getClass().getName() + ": failed to destory VLAN " + device + " on host " + _host.uuid + " due to " + e.toString());
+                        s_logger.trace("Catch " + e.getClass().getName() + ": failed to destory VLAN " + device + " on host " + _host.uuid + " due to " + e.toString());
                     }
                 }
                 return;


[29/50] git commit: updated refs/heads/4.4 to d5220a8

Posted by da...@apache.org.
CLOUDSTACK-6929: HAPlanner (SkipHeuresticsPlanner) gets added into the list of regular planners currently, add it in the exclude list. Also create allocator order list

(cherry picked from commit 6fca4eb0f1193b4612d1057784d24d7db1d7b048)


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

Branch: refs/heads/4.4
Commit: 2422754d42fd9571470c531e045a5edfbd52174c
Parents: 388af6c
Author: Nitin Mehta <ni...@citrix.com>
Authored: Tue Jun 17 16:59:30 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:38 2014 +0200

----------------------------------------------------------------------
 .../cloudstack/core/spring-core-registry-core-context.xml         | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2422754d/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
index d54823a..819fb83 100644
--- a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
+++ b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
@@ -75,6 +75,7 @@
         <property name="orderConfigDefault"
             value="FirstFitPlanner,UserDispersingPlanner,UserConcentratedPodPlanner,ImplicitDedicationPlanner,BareMetalPlanner" />
         <property name="excludeKey" value="deployment.planners.exclude" />
+	<property name="excludeDefault" value="SkipHeuresticsPlanner" />
     </bean>
 
     <bean id="haPlannersRegistry"
@@ -89,6 +90,8 @@
 
     <bean id="hostAllocatorsRegistry"
         class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+	<property name="orderConfigKey" value="host.allocators.order" />
+        <property name="orderConfigDefault" value="FirstFitRouting" />
         <property name="excludeKey" value="host.allocators.exclude" />
         <property name="excludeDefault"
             value="RandomAllocator,TestingAllocator,FirstFitAllocator,RecreateHostAllocator" />