mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[openstack|image] Define get method for images
This commit is contained in:
parent
51371d1788
commit
058c3301ac
2 changed files with 6 additions and 0 deletions
|
@ -18,6 +18,7 @@ module Fog
|
|||
def find_by_id(id)
|
||||
self.find {|image| image.id == id}
|
||||
end
|
||||
alias_method :get, :find_by_id
|
||||
|
||||
def public
|
||||
images = load(service.list_public_images_detailed.body['images'])
|
||||
|
|
|
@ -7,6 +7,11 @@ Shindo.tests("Fog::Image[:openstack] | images", ['openstack']) do
|
|||
image.id == @instance['image']['id']
|
||||
end
|
||||
|
||||
tests('#get').succeeds do
|
||||
image = Fog::Image[:openstack].images.get(@instance['image']['id'])
|
||||
image.id == @instance['image']['id']
|
||||
end
|
||||
|
||||
tests('#destroy').succeeds do
|
||||
Fog::Image[:openstack].images.destroy(@instance['image']['id'])
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue