Skip to content
Browse files

fixed bug, quantum api need no underscore valiable name. (ex floatingips

  • Loading branch information...
1 parent cc57271 commit 6d648dd8a7c61f4253bb9b93c467b8c8c768edd7 @kanetann committed
View
2 lib/fog/openstack/models/network/floating_ip.rb
@@ -32,7 +32,7 @@ def create
merge_attributes(connection.create_floating_ip(self.floating_network_id,
- self.attributes).body['floating_ip'])
+ self.attributes).body['floatingip'])
self
end
View
4 lib/fog/openstack/models/network/floating_ips.rb
@@ -17,11 +17,11 @@ def initialize(attributes)
def all(filters = filters)
self.filters = filters
- load(connection.list_floating_ips(filters).body['floating_ips'])
+ load(connection.list_floating_ips(filters).body['floatingips'])
end
def get(floating_network_id)
- if floating_ip = connection.get_floating_ip(floating_network_id).body['floating_ip']
+ if floating_ip = connection.get_floating_ip(floating_network_id).body['floatingip']
new(floating_ip)
end
rescue Fog::Network::OpenStack::NotFound
View
6 lib/fog/openstack/requests/network/associate_floating_ip.rb
@@ -5,14 +5,14 @@ class OpenStack
class Real
def associate_floating_ip(floating_ip_id, port_id, options = {})
data = {
- 'floating_ip' => {
+ 'floatingip' => {
'port_id' => port_id,
}
}
vanilla_options = [:fixed_ip_address]
vanilla_options.reject{ |o| options[o].nil? }.each do |key|
- data['floating_ip'][key] = options[key]
+ data['floatingip'][key] = options[key]
end
request(
@@ -39,7 +39,7 @@ def associate_floating_ip(floating_ip_id, port_id, options = {})
}
self.data[:floating_ips][data['floating_ip_id']] = data
- response.body = { 'floating_ip' => data }
+ response.body = { 'floatingip' => data }
response
end
end
View
6 lib/fog/openstack/requests/network/create_floating_ip.rb
@@ -5,7 +5,7 @@ class OpenStack
class Real
def create_floating_ip(floating_network_id, options = {})
data = {
- 'floating_ip' => {
+ 'floatingip' => {
'floating_network_id' => floating_network_id,
'port_id' => options[:port_id],
'tenant_id' => options[:tenant_id],
@@ -15,7 +15,7 @@ def create_floating_ip(floating_network_id, options = {})
vanilla_options = [:port_id, :tenant_id, :fixed_ip_address ]
vanilla_options.reject{ |o| options[o].nil? }.each do |key|
- data['floating_ip'][key] = options[key]
+ data['floatingip'][key] = options[key]
end
request(
@@ -40,7 +40,7 @@ def create_floating_ip(floating_network_id, options = {})
'router_id' => nil,
}
self.data[:floating_ips][data['id']] = data
- response.body = { 'floating_ip' => data }
+ response.body = { 'floatingip' => data }
response
end
end
View
2 lib/fog/openstack/requests/network/delete_floating_ip.rb
@@ -15,7 +15,7 @@ def delete_floating_ip(floating_ip_id)
class Mock
def delete_floating_ip(floating_ip_id)
response = Excon::Response.new
- if list_floating_ips.body['floating_ips'].map { |r| r['id'] }.include? floating_ip_id
+ if list_floating_ips.body['floatingips'].map { |r| r['id'] }.include? floating_ip_id
self.data[:floating_ips].delete(floating_ip_id)
response.status = 204
response
View
6 lib/fog/openstack/requests/network/disassociate_floating_ip.rb
@@ -5,14 +5,14 @@ class OpenStack
class Real
def disassociate_floating_ip(floating_ip_id, options = {})
data = {
- 'floating_ip' => {
+ 'floatingip' => {
'port_id' => nil,
}
}
vanilla_options = [:fixed_ip_address]
vanilla_options.reject{ |o| options[o].nil? }.each do |key|
- data['floating_ip'][key] = options[key]
+ data['floatingip'][key] = options[key]
end
request(
@@ -39,7 +39,7 @@ def disassociate_floating_ip(floating_ip_id, options = {})
}
self.data[:floating_ips][data['floating_ip_id']] = data
- response.body = { 'floating_ip' => data }
+ response.body = { 'floatingip' => data }
response
end
end
View
2 lib/fog/openstack/requests/network/get_floating_ip.rb
@@ -18,7 +18,7 @@ def get_floating_ip(floating_ip_id)
if data = self.data[:floating_ips][floating_ip_id]
response.status = 200
response.body = {
- "floating_ip" => {
+ "floatingip" => {
"id" => "00000000-0000-0000-0000-000000000000",
# changed
# "floating_ip_id" => floating_ip_id,
View
2 lib/fog/openstack/requests/network/list_floating_ips.rb
@@ -16,7 +16,7 @@ def list_floating_ips(filters = {})
class Mock
def list_floating_ips(filters = {})
Excon::Response.new(
- :body => { 'floating_ips' => self.data[:floating_ips].values },
+ :body => { 'floatingips' => self.data[:floating_ips].values },
:status => 200
)
end

0 comments on commit 6d648dd

Please sign in to comment.
Something went wrong with that request. Please try again.