Issue #2141 Adding owner-id to the filter for Snapshot (#2142)

* Adding owner-id to the filter for Snapshot
This commit is contained in:
Jeffery Smith 2019-05-25 05:34:59 -04:00 committed by Terry Cain
parent 6838d7964f
commit 4a99dcddb2
2 changed files with 7 additions and 0 deletions

View File

@ -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')

View File

@ -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():