incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [26/29] git commit: refs/heads/ui-plugins - CLOUDSTACK-1120 [EC2 Query API] Parameter 'keynames' is not honoured by DescribeKeyPairs
Date Mon, 11 Feb 2013 19:48:59 GMT
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/ui-plugins
Commit: 05280976e5caa4cc9105223fea96163abb0b6935
Parents: 9e13533
Author: Likitha Shetty <Likitha.Shetty@citrix.com>
Authored: Fri Feb 8 17:29:13 2013 -0800
Committer: Prachi Damle <prachi@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();


Mime
View raw message