You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/02/13 02:07:00 UTC

[41/50] [abbrv] git commit: refs/heads/vim51_win8 - CLOUDSTACK-1120 [EC2 Query API] Parameter 'keynames' is not honoured by DescribeKeyPairs

CLOUDSTACK-1120 [EC2 Query API] Parameter 'keynames' is not honoured by DescribeKeyPairs

When EC2DesribeKeyPairs is called with filter 'keynames' it ignored the key-name provided and lists all the key-pairs


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

Branch: refs/heads/vim51_win8
Commit: 05280976e5caa4cc9105223fea96163abb0b6935
Parents: 9e13533
Author: Likitha Shetty <Li...@citrix.com>
Authored: Fri Feb 8 17:29:13 2013 -0800
Committer: Prachi Damle <pr...@cloud.com>
Committed: Mon Feb 11 11:09:36 2013 -0800

----------------------------------------------------------------------
 .../com/cloud/bridge/service/EC2RestServlet.java   |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/05280976/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
----------------------------------------------------------------------
diff --git a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java b/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
index 0186db4..ca910e0 100644
--- a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
+++ b/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java
@@ -1678,13 +1678,16 @@ public class EC2RestServlet extends HttpServlet {
             throws ADBException, XMLStreamException, IOException {
         EC2DescribeKeyPairs ec2Request = new EC2DescribeKeyPairs();
 
-
-        String[] keyNames = request.getParameterValues( "KeyName" );
-        if (keyNames != null) { 
-            for (String keyName : keyNames) {
-                ec2Request.addKeyName(keyName);
+        Enumeration<?> names = request.getParameterNames();
+        while( names.hasMoreElements()) {
+            String key = (String)names.nextElement();
+            if (key.startsWith("KeyName")) {
+                String[] value = request.getParameterValues( key );
+                if (null != value && 0 < value.length)
+                    ec2Request.addKeyName(value[0]);
             }
         }
+
         EC2Filter[] filterSet = extractFilters( request );
         if (null != filterSet){
             EC2KeyPairFilterSet vfs = new EC2KeyPairFilterSet();