[openstack|network] fixing broken tests

This commit is contained in:
Kyle Rames 2014-04-01 16:26:41 -05:00
parent 2f5d0efc65
commit b83441333c
4 changed files with 10 additions and 8 deletions

View File

@ -10,7 +10,7 @@ module Fog
attribute :name
attribute :tenant_id
attribute :external_gateway_info
attribute :admin_state_up
attribute :admin_state_up, :type => :boolean
attribute :status
def destroy

View File

@ -32,15 +32,16 @@ module Fog
def create
requires :name
merge_attributes(service.create_router(self.name,
self.attributes).body['router'])
response = service.create_router(self.name, self.attributes)
merge_attributes(response.body['router'])
self
end
def update
requires :id
merge_attributes(service.update_router(self.id,
self.attributes).body['router'])
response = service.update_router(self.id, self.attributes)
merge_attributes(response.body['router'])
self
end

View File

@ -68,8 +68,9 @@ module Fog
end
end
options.keys.each do |k|
router[k.to_s] = options[k]
router[k] = options[k]
end
response.body = { 'router' => router }
response.status = 200
response

View File

@ -33,7 +33,7 @@ Shindo.tests('Fog::Network[:openstack] | router requests', ['openstack']) do
:name => 'net_name',
:external_gateway_info => { :network_id => 'net_id' },
:status => 'ACTIVE',
:admin_state_up => 'true'
:admin_state_up => true
}
Fog::Network[:openstack].update_router(router_id, attributes).body
end
@ -45,7 +45,7 @@ Shindo.tests('Fog::Network[:openstack] | router requests', ['openstack']) do
:name => 'net_name',
:external_gateway_info => net,
:status => 'ACTIVE',
:admin_state_up => 'true'
:admin_state_up => true
}
Fog::Network[:openstack].update_router(router_id, attributes).body
end