mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Rackspace LB: Fixed issues with connection logging model
This commit is contained in:
parent
0e172998a8
commit
e5ab6bb603
1 changed files with 21 additions and 3 deletions
|
@ -8,7 +8,7 @@ module Fog
|
||||||
identity :id
|
identity :id
|
||||||
|
|
||||||
attribute :cluster
|
attribute :cluster
|
||||||
attribute :connection_logging, :aliases => 'connectionLogging', :squash => 'enabled'
|
attribute :connection_logging, :aliases => 'connectionLogging'
|
||||||
attribute :port
|
attribute :port
|
||||||
attribute :protocol
|
attribute :protocol
|
||||||
attribute :algorithm
|
attribute :algorithm
|
||||||
|
@ -45,18 +45,22 @@ module Fog
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def connection_logging
|
||||||
|
attributes[:connection_logging]
|
||||||
|
end
|
||||||
|
|
||||||
def virtual_ips=(new_virtual_ips=[])
|
def virtual_ips=(new_virtual_ips=[])
|
||||||
virtual_ips.load(new_virtual_ips)
|
virtual_ips.load(new_virtual_ips)
|
||||||
end
|
end
|
||||||
|
|
||||||
def enable_connection_logging
|
def enable_connection_logging
|
||||||
connection.set_connection_logging identity, true
|
connection.set_connection_logging identity, true
|
||||||
connection_logging = true
|
attributes[:connection_logging] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
def disable_connection_logging
|
def disable_connection_logging
|
||||||
connection.set_connection_logging identity, false
|
connection.set_connection_logging identity, false
|
||||||
connection_logging = false
|
attributes[:connection_logging] = false
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
@ -110,6 +114,20 @@ module Fog
|
||||||
{ :address => node.address, :port => node.port, :condition => node.condition, :weight => node.weight }
|
{ :address => node.address, :port => node.port, :condition => node.condition, :weight => node.weight }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def connection_logging=(new_value)
|
||||||
|
if !new_value.nil? and new_value.is_a?(Hash)
|
||||||
|
attributes[:connection_logging] = case new_value['enabled']
|
||||||
|
when 'true'
|
||||||
|
true
|
||||||
|
when 'false'
|
||||||
|
false
|
||||||
|
end
|
||||||
|
else
|
||||||
|
attributes[:connection_logging] = new_value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue