Filters for DescribeInstances in EC2 API do not work

Bug #922835 reported by Ryan Lane
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Stephen Gran

Bug Description

Filters for DescribeInstances EC2 API do not work. This is a two part problem:

1. describe_instances in api/ec2/cloud.py doesn't pass the arguments to _format_describe_instances
2. Even when passing the args to _format_describe_instances, the filters don't work as described in the EC2 api

The EC2 API describes the function this way (http://docs.amazonwebservices.com/AWSSDKforPHP/latest/index.html#m=AmazonEC2/describe_instances):

$response = $ec2->describe_instances(array(
    'Filter' => array(
        array('Name' => 'project-id', 'Value' => array( 'project1', 'project2')),
    )
));

When passing the arguments to _format_describe_instances, in the current implementation, it requires a call like this:

$response = $ec2->describe_instances(array(
    'project_id' => array('project1', 'project2'),
));

Tags: ec2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/3524

Changed in nova:
status: New → In Progress
Revision history for this message
Vish Ishaya (vishvananda) wrote :

When you do the second part of this fix, can you add a test for the filters?

Revision history for this message
Ryan Lane (rlane) wrote :

Sure

Revision history for this message
Thierry Carrez (ttx) wrote :

Ryan, if you no longer work on this, unassign yourself and set back status to Confirmed

Changed in nova:
assignee: nobody → Ryan Lane (rlane)
importance: Undecided → Medium
tags: added: ec2
Revision history for this message
Thierry Carrez (ttx) wrote :

Looks like you're not working on that anymore. Please set back to InProgress and reassign to you if you're working on proposing a change for merging.

Changed in nova:
assignee: Ryan Lane (rlane) → nobody
status: In Progress → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/20376

Changed in nova:
assignee: nobody → Stephen Gran (sgran)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/20410

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/20410
Committed: http://github.com/openstack/nova/commit/d3b62c1b49e4dc05d266ce679724c236456f863d
Submitter: Jenkins
Branch: master

commit d3b62c1b49e4dc05d266ce679724c236456f863d
Author: Stephen Gran <email address hidden>
Date: Thu Jan 24 16:55:40 2013 +0000

    Pass parameter 'filter' back to model layer

    This allows the API to pass back additional arguments to filter search
    results by. This will be useful for resource tagging or other filters.

    DocImpact: Adds 'Filter' parameter to DescribeInstance (see
    http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstances.html)

    Fixes: bug #922835

    Change-Id: I58cc12df650829ed7eb685184a22186d8a5406f4
    Signed-off-by: Stephen Gran <email address hidden>

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-3 → 2013.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/210637

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Nicolas Simonds (<email address hidden>) on branch: master
Review: https://review.openstack.org/210637
Reason: All signs point to this code being ripped out of Nova entirely, so this patch set makes no sense.

Abandoning.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.