cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sate...@apache.org
Subject git commit: updated refs/heads/vmware-datamodel to 928231c
Date Thu, 23 May 2013 05:48:37 GMT
Updated Branches:
  refs/heads/vmware-datamodel 599b82695 -> 928231cd6


Updated exception handling with appropriate Exception types.
Cleanup trailing whitespaces in unit test class.


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

Branch: refs/heads/vmware-datamodel
Commit: 928231cd66dc7be2159afb184a42b79f86be9e3c
Parents: 599b826
Author: Sateesh Chodapuneedi <sateesh@apache.org>
Authored: Thu May 23 11:16:22 2013 +0530
Committer: Sateesh Chodapuneedi <sateesh@apache.org>
Committed: Thu May 23 11:16:22 2013 +0530

----------------------------------------------------------------------
 .../hypervisor/vmware/VmwareDatacenterService.java |    4 ++--
 .../api/command/admin/zone/AddVmwareDcCmd.java     |    4 +++-
 .../api/command/admin/zone/RemoveVmwareDcCmd.java  |    4 +++-
 .../vmware/VmwareDatacenterApiUnitTest.java        |    4 ++--
 4 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/928231cd/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareDatacenterService.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareDatacenterService.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareDatacenterService.java
index d1d0c9a..5e80e18 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareDatacenterService.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareDatacenterService.java
@@ -26,7 +26,7 @@ import com.cloud.utils.component.PluggableService;
 
 public interface VmwareDatacenterService extends PluggableService {
 
-    public VmwareDatacenterVO addVmwareDatacenter(AddVmwareDcCmd cmd) throws IllegalArgumentException,
DiscoveryException, ResourceInUseException, Exception;
+    public VmwareDatacenterVO addVmwareDatacenter(AddVmwareDcCmd cmd) throws IllegalArgumentException,
DiscoveryException, ResourceInUseException;
 
-    public boolean removeVmwareDatacenter(RemoveVmwareDcCmd cmd) throws IllegalArgumentException,
ResourceInUseException, Exception;
+    public boolean removeVmwareDatacenter(RemoveVmwareDcCmd cmd) throws IllegalArgumentException,
ResourceInUseException;
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/928231cd/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/AddVmwareDcCmd.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/AddVmwareDcCmd.java
b/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/AddVmwareDcCmd.java
index 0011e10..7168c7f 100644
--- a/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/AddVmwareDcCmd.java
+++ b/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/AddVmwareDcCmd.java
@@ -34,6 +34,7 @@ import com.cloud.exception.ResourceInUseException;
 import com.cloud.hypervisor.vmware.VmwareDatacenterService;
 import com.cloud.hypervisor.vmware.VmwareDatacenterVO;
 import com.cloud.user.Account;
+import com.cloud.utils.exception.CloudRuntimeException;
 
 @APICommand(name = "addVmwareDc", description="Adds a VMware datacenter to specified zone",
responseObject=VmwareDatacenterResponse.class)
 public class AddVmwareDcCmd extends BaseCmd {
@@ -114,7 +115,8 @@ public class AddVmwareDcCmd extends BaseCmd {
             throw e;
         } catch (IllegalArgumentException ex) {
             throw new IllegalArgumentException(ex.getMessage());
-        } catch (Exception e) {
+        } catch (CloudRuntimeException runtimeEx) {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeEx.getMessage());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/928231cd/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/RemoveVmwareDcCmd.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/RemoveVmwareDcCmd.java
b/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/RemoveVmwareDcCmd.java
index 1c549db..a74c91b 100644
--- a/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/RemoveVmwareDcCmd.java
+++ b/plugins/hypervisors/vmware/src/org/apache/cloudstack/api/command/admin/zone/RemoveVmwareDcCmd.java
@@ -40,6 +40,7 @@ import com.cloud.exception.ResourceUnavailableException;
 import com.cloud.hypervisor.vmware.VmwareDatacenterService;
 import com.cloud.network.element.CiscoNexusVSMElementService;
 import com.cloud.user.Account;
+import com.cloud.utils.exception.CloudRuntimeException;
 
 @APICommand(name = "removeVmwareDc", responseObject=SuccessResponse.class, description="Remove
a VMware datacenter from a zone.")
 public class RemoveVmwareDcCmd extends BaseCmd {
@@ -80,7 +81,8 @@ public class RemoveVmwareDcCmd extends BaseCmd {
             throw e;
         } catch (IllegalArgumentException ex) {
             throw new IllegalArgumentException(ex.getMessage());
-        } catch (Exception e) {
+        } catch (CloudRuntimeException runtimeEx) {
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, runtimeEx.getMessage());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/928231cd/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/VmwareDatacenterApiUnitTest.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/VmwareDatacenterApiUnitTest.java
b/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/VmwareDatacenterApiUnitTest.java
index 6730b22..f0fb08e 100644
--- a/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/VmwareDatacenterApiUnitTest.java
+++ b/plugins/hypervisors/vmware/test/com/cloud/hypervisor/vmware/VmwareDatacenterApiUnitTest.java
@@ -119,7 +119,7 @@ public class VmwareDatacenterApiUnitTest {
     @Inject
     ClusterDetailsDao _clusterDetailsDao;
 
-    @Inject 
+    @Inject
     ConfigurationDao _configDao;
 
     @Inject
@@ -163,7 +163,7 @@ public class VmwareDatacenterApiUnitTest {
         ComponentContext.initComponentsLifeCycle();
         MockitoAnnotations.initMocks(this);
 
-        DataCenterVO zone = new DataCenterVO(UUID.randomUUID().toString(), "test", "8.8.8.8",
null, "10.0.0.1", null,  "10.0.0.1/24", 
+        DataCenterVO zone = new DataCenterVO(UUID.randomUUID().toString(), "test", "8.8.8.8",
null, "10.0.0.1", null,  "10.0.0.1/24",
                 null, null, NetworkType.Basic, null, null, true,  true, null, null);
         zoneId = 1L;
 


Mime
View raw message