mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Back to using Owner. A couple of tests for it too.
This commit is contained in:
parent
d2e06e96ca
commit
2165c31629
3 changed files with 20 additions and 2 deletions
|
@ -69,6 +69,14 @@ module Fog
|
||||||
Fog::Mock.not_implemented
|
Fog::Mock.not_implemented
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if owner = filters.delete('Owner')
|
||||||
|
if owner == 'self'
|
||||||
|
filters['owner-id'] = self.data[:owner_id]
|
||||||
|
else
|
||||||
|
filters['owner-alias'] = owner
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
response = Excon::Response.new
|
response = Excon::Response.new
|
||||||
|
|
||||||
aliases = {
|
aliases = {
|
||||||
|
|
|
@ -79,7 +79,7 @@ module Fog
|
||||||
'ramdiskId' => Fog::AWS::Mock.ramdisk_id,
|
'ramdiskId' => Fog::AWS::Mock.ramdisk_id,
|
||||||
'platform' => 'Linux',
|
'platform' => 'Linux',
|
||||||
'stateReason' => {},
|
'stateReason' => {},
|
||||||
'imageOwnerAlias' => 'self',
|
'imageOwnerAlias' => self.data[:owner_id],
|
||||||
'name' => name,
|
'name' => name,
|
||||||
'description' => description,
|
'description' => description,
|
||||||
'rootDeviceType' => '',
|
'rootDeviceType' => '',
|
||||||
|
|
|
@ -44,10 +44,20 @@ Shindo.tests('Fog::Compute[:aws] | image requests', ['aws']) do
|
||||||
end
|
end
|
||||||
|
|
||||||
@image_id = @image['imageId']
|
@image_id = @image['imageId']
|
||||||
|
|
||||||
|
tests("#describe_images('Owner' => 'self')").formats(@describe_images_format) do
|
||||||
|
Fog::Compute[:aws].describe_images('Owner' => 'self').body
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
tests("#describe_images('image-id' => '#{@image_id}')").formats(@describe_images_format) do
|
tests("#describe_images('image-id' => '#{@image_id}')").formats(@describe_images_format) do
|
||||||
Fog::Compute[:aws].describe_images('image-id' => @image_id).body
|
@other_image = Fog::Compute[:aws].describe_images('image-id' => @image_id).body
|
||||||
|
end
|
||||||
|
|
||||||
|
unless Fog.mocking?
|
||||||
|
tests("#describe_images('Owner' => '#{@other_image['imageOwnerAlias']}', 'image-id' => '#{@image_id}')").formats(@describe_images_format) do
|
||||||
|
Fog::Compute[:aws].describe_images('Owner' => @other_image['imageOwnerAlias'], 'image-id' => @image_id).body
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue