cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aprat...@apache.org
Subject [1/2] git commit: updated refs/heads/master to d3d6350
Date Thu, 20 Jun 2013 06:13:43 GMT
Updated Branches:
  refs/heads/master f9e709428 -> d3d635021


Add fix for CLOUDSTACK-2168. Changed listAll output to conform to the same output as listconfiguration

Signed-off-by: Abhinandan Prateek <aprateek@apache.org>


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

Branch: refs/heads/master
Commit: 576884ec10b4a46b243b8138926c0fc650bcdaba
Parents: f9e7094
Author: Ian Duffy <ian@ianduffy.ie>
Authored: Mon Jun 17 15:00:19 2013 +0100
Committer: Abhinandan Prateek <aprateek@apache.org>
Committed: Thu Jun 20 11:28:22 2013 +0530

----------------------------------------------------------------------
 .../api/command/admin/ldap/LDAPConfigCmd.java   | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/576884ec/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java b/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
index 2726f84..efd1c76 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
@@ -17,6 +17,9 @@
 package org.apache.cloudstack.api.command.admin.ldap;
 
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.naming.NamingException;
 
 import org.apache.cloudstack.api.APICommand;
@@ -24,7 +27,9 @@ import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.HypervisorCapabilitiesResponse;
 import org.apache.cloudstack.api.response.LDAPConfigResponse;
+import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.log4j.Logger;
 
 import com.cloud.exception.ConcurrentOperationException;
@@ -158,9 +163,16 @@ public class LDAPConfigCmd extends BaseCmd  {
               if (getListAll()){
                   // return the existing conf
                   LDAPConfigCmd cmd = _configService.listLDAPConfig(this);
-                  LDAPConfigResponse lr = _responseGenerator.createLDAPConfigResponse(cmd.getHostname(),
cmd.getPort(), cmd.getUseSSL(), cmd.getQueryFilter(), cmd.getSearchBase(), cmd.getBindDN());
-                  lr.setResponseName(getCommandName());
-                  this.setResponseObject(lr);
+                  ListResponse<LDAPConfigResponse> response = new ListResponse<LDAPConfigResponse>();
+                  List<LDAPConfigResponse> responses = new ArrayList<LDAPConfigResponse>();
+
+                  if(!cmd.getHostname().equals("")) {
+                  	responses.add(_responseGenerator.createLDAPConfigResponse(cmd.getHostname(),
cmd.getPort(), cmd.getUseSSL(), cmd.getQueryFilter(), cmd.getSearchBase(), cmd.getBindDN()));
+                  }
+                  
+                  response.setResponses(responses);
+                  response.setResponseName(getCommandName());
+                  this.setResponseObject(response);
               }
               else if (getHostname()==null || getSearchBase() == null || getQueryFilter()
== null) {
                   throw new InvalidParameterValueException("You need to provide hostname,
searchbase and queryfilter to configure your LDAP server");
@@ -191,4 +203,4 @@ public class LDAPConfigCmd extends BaseCmd  {
     }
 
 
-}
+}
\ No newline at end of file


Mime
View raw message