* Adding owner-id to the filter for Snapshot
This commit is contained in:
parent
6838d7964f
commit
4a99dcddb2
@ -1881,6 +1881,8 @@ class Snapshot(TaggedEC2Resource):
|
||||
return str(self.encrypted).lower()
|
||||
elif filter_name == 'status':
|
||||
return self.status
|
||||
elif filter_name == 'owner-id':
|
||||
return self.owner_id
|
||||
else:
|
||||
return super(Snapshot, self).get_filter_value(
|
||||
filter_name, 'DescribeSnapshots')
|
||||
|
@ -394,6 +394,11 @@ def test_snapshot_filters():
|
||||
set([snap.id for snap in snapshots_by_encrypted]
|
||||
).should.equal({snapshot3.id})
|
||||
|
||||
snapshots_by_owner_id = conn.get_all_snapshots(
|
||||
filters={'owner-id': '123456789012'})
|
||||
set([snap.id for snap in snapshots_by_owner_id]
|
||||
).should.equal({snapshot1.id, snapshot2.id, snapshot3.id})
|
||||
|
||||
|
||||
@mock_ec2_deprecated
|
||||
def test_snapshot_attribute():
|
||||
|
Loading…
Reference in New Issue
Block a user