Add filter for volume-id on volumes.
This commit is contained in:
parent
82b0b12e45
commit
ee33ff582c
@ -1453,6 +1453,9 @@ class Volume(TaggedEC2Resource):
|
||||
if filter_name == 'status':
|
||||
return self.status
|
||||
|
||||
if filter_name == 'volume-id':
|
||||
return self.id
|
||||
|
||||
filter_value = super(Volume, self).get_filter_value(filter_name)
|
||||
|
||||
if filter_value is None:
|
||||
|
@ -95,6 +95,9 @@ def test_volume_filters():
|
||||
volumes_by_status = conn.get_all_volumes(filters={'status': 'in-use'})
|
||||
set([vol.id for vol in volumes_by_status]).should.equal(set([block_mapping.volume_id]))
|
||||
|
||||
volumes_by_id = conn.get_all_volumes(filters={'volume-id': volume1.id})
|
||||
set([vol.id for vol in volumes_by_id]).should.equal(set([volume1.id]))
|
||||
|
||||
volumes_by_tag_key = conn.get_all_volumes(filters={'tag-key': 'testkey1'})
|
||||
set([vol.id for vol in volumes_by_tag_key]).should.equal(set([volume1.id]))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user