mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Fix orchestration request status codes.
Make the OpenStack Orchestration return codes match what actually gets returned from Heat.
This commit is contained in:
parent
1854e9a040
commit
d49b10b1dc
5 changed files with 15 additions and 4 deletions
|
@ -22,6 +22,7 @@ module Fog
|
|||
}.merge(options)
|
||||
|
||||
request(
|
||||
:expects => 201,
|
||||
:path => 'stacks',
|
||||
:method => 'POST',
|
||||
:body => MultiJson.encode(params)
|
||||
|
@ -45,8 +46,10 @@ module Fog
|
|||
}
|
||||
|
||||
response = Excon::Response.new
|
||||
response.status = 202
|
||||
response.body = {}
|
||||
response.status = 201
|
||||
response.body = {
|
||||
'id' => stack_id,
|
||||
'links'=>[{"href"=>"http://localhost:8004/v1/fake_tenant_id/stacks/#{stack_name}/#{stack_id}", "rel"=>"self"}]}
|
||||
response
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,6 +14,7 @@ module Fog
|
|||
|
||||
def delete_stack(stack_name, stack_id)
|
||||
request(
|
||||
:expects => 204,
|
||||
:path => "stacks/#{stack_name}/#{stack_id}",
|
||||
:method => 'DELETE'
|
||||
)
|
||||
|
@ -26,7 +27,7 @@ module Fog
|
|||
self.data[:stacks].delete(stack_id)
|
||||
|
||||
response = Excon::Response.new
|
||||
response.status = 202
|
||||
response.status = 204
|
||||
response.body = {}
|
||||
response
|
||||
end
|
||||
|
|
|
@ -25,6 +25,7 @@ module Fog
|
|||
|
||||
def list_stacks(options = {})
|
||||
request(
|
||||
:expects => 200,
|
||||
:path => 'stacks',
|
||||
:method => 'GET',
|
||||
:query => options
|
||||
|
|
|
@ -20,6 +20,7 @@ module Fog
|
|||
}.merge(options)
|
||||
|
||||
request(
|
||||
:expects => 202,
|
||||
:path => 'stacks',
|
||||
:method => 'PUT',
|
||||
:body => MultiJson.encode(params)
|
||||
|
|
|
@ -10,8 +10,13 @@ Shindo.tests('Fog::Orchestration[:openstack] | stack requests', ['openstack']) d
|
|||
'updated_time' => Time
|
||||
}
|
||||
|
||||
@create_format = {
|
||||
'id' => String,
|
||||
'links' => Array,
|
||||
}
|
||||
|
||||
tests('success') do
|
||||
tests('#create_stack("teststack")').formats({}) do
|
||||
tests('#create_stack("teststack")').formats(@create_format) do
|
||||
Fog::Orchestration[:openstack].create_stack("teststack").body
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue