diff --git a/api/src/com/cloud/api/commands/AddClusterCmd.java b/api/src/com/cloud/api/commands/AddClusterCmd.java
index 2b1daadc786..caa9e89e8de 100755
--- a/api/src/com/cloud/api/commands/AddClusterCmd.java
+++ b/api/src/com/cloud/api/commands/AddClusterCmd.java
@@ -48,7 +48,7 @@ public class AddClusterCmd extends BaseCmd {
private String password;
@IdentityMapper(entityTableName="host_pod_ref")
- @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID for the host")
+ @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="the Pod ID for the host")
private Long podId;
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the URL")
diff --git a/console-viewer/.project b/console-viewer/.project
new file mode 100644
index 00000000000..55284cd29b2
--- /dev/null
+++ b/console-viewer/.project
@@ -0,0 +1,17 @@
+
+
+ console-viewer
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/console/.project b/console/.project
new file mode 100644
index 00000000000..d1df45df74b
--- /dev/null
+++ b/console/.project
@@ -0,0 +1,17 @@
+
+
+ console
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 50d0c9d4857..ef1a1e441ec 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -313,8 +313,8 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
@Override
public List extends Cluster> discoverCluster(AddClusterCmd cmd) throws IllegalArgumentException, DiscoveryException {
- Long dcId = cmd.getZoneId();
- Long podId = cmd.getPodId();
+ long dcId = cmd.getZoneId();
+ long podId = cmd.getPodId();
String clusterName = cmd.getClusterName();
String url = cmd.getUrl();
String username = cmd.getUsername();
@@ -338,15 +338,13 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma
}
// Check if the pod exists in the system
- if (podId != null) {
- if (_podDao.findById(podId) == null) {
- throw new InvalidParameterValueException("Can't find pod by id " + podId);
- }
- // check if pod belongs to the zone
- HostPodVO pod = _podDao.findById(podId);
- if (!Long.valueOf(pod.getDataCenterId()).equals(dcId)) {
- throw new InvalidParameterValueException("Pod " + podId + " doesn't belong to the zone " + dcId);
- }
+ if (_podDao.findById(podId) == null) {
+ throw new InvalidParameterValueException("Can't find pod by id " + podId);
+ }
+ // check if pod belongs to the zone
+ HostPodVO pod = _podDao.findById(podId);
+ if (!Long.valueOf(pod.getDataCenterId()).equals(dcId)) {
+ throw new InvalidParameterValueException("Pod " + podId + " doesn't belong to the zone " + dcId);
}
// Verify cluster information and create a new cluster if needed