1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Not specifying Owner details caused issue in Query Mock

In trying to emulate a bug in the API in Mock mode, we were not populating
required fields in the get_execute_query Mock, which were in turn intermittently
causing test failures.

Fix these two cases to return the correct value, but store the correct data in our Mock.
This commit is contained in:
Mike Pountney 2014-09-24 23:24:00 +01:00
parent 28cf497e03
commit c033ee8c82
2 changed files with 15 additions and 5 deletions

View file

@ -41,7 +41,10 @@ module Fog
)
end
owner = {:href => '', :name => nil, :type => nil} #known-bug: admin-api does not return owner.
owner = {
:href => make_href("admin/edgeGateway/#{id}"),
:type => 'application/vnd.vmware.vcloud.gateway+xml'
}
task_id = enqueue_task(
"Configuring edgegateway(#{id})", 'networkConfigureEdgeGatewayServices', owner,
:on_success => lambda do
@ -49,11 +52,14 @@ module Fog
end
)
task = task_body(task_id)
task.delete(:Owner) # known bug - admin tasks do not return Owner
body = {
:xmlns => xmlns,
:xmlns_xsi => xmlns_xsi,
:xsi_schemaLocation => xsi_schema_location,
}.merge(task_body(task_id))
}.merge(task)
Excon::Response.new(
:status => 202,

View file

@ -131,19 +131,23 @@ module Fog
network_body[:FenceMode] = configuration[:FenceMode] if ip_scope.key?(:FenceMode)
end
owner = {:href => '', :name => nil, :type => nil} #known-bug: admin-api does not return owner.
owner = {
:href => make_href("#{type}/#{id}"),
:type => "application/vnd.vmware.vcloud.#{type}+xml"
}
task_id = enqueue_task(
"Updating #{type} #{name} (#{id})", 'networkUpdateNetwork', owner,
:on_success => lambda do
data[:networks][id] = network_body
end
)
task = task_body(task_id)
task.delete(:Owner) #known-bug: admin-api does not return owner.
body = {
:xmlns => xmlns,
:xmlns_xsi => xmlns_xsi,
:xsi_schemaLocation => xsi_schema_location,
}.merge(task_body(task_id))
}.merge(task)
Excon::Response.new(
:status => 202,