mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[openstack|network] fixing broken tests
This commit is contained in:
parent
2f5d0efc65
commit
b83441333c
4 changed files with 10 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue