1
0
Fork 0
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:
Brian Hartsock 2011-07-27 18:00:18 -04:00
parent 0e172998a8
commit e5ab6bb603

View file

@ -8,7 +8,7 @@ module Fog
identity :id
attribute :cluster
attribute :connection_logging, :aliases => 'connectionLogging', :squash => 'enabled'
attribute :connection_logging, :aliases => 'connectionLogging'
attribute :port
attribute :protocol
attribute :algorithm
@ -45,18 +45,22 @@ module Fog
end
end
def connection_logging
attributes[:connection_logging]
end
def virtual_ips=(new_virtual_ips=[])
virtual_ips.load(new_virtual_ips)
end
def enable_connection_logging
connection.set_connection_logging identity, true
connection_logging = true
attributes[:connection_logging] = true
end
def disable_connection_logging
connection.set_connection_logging identity, false
connection_logging = false
attributes[:connection_logging] = false
end
def destroy
@ -110,6 +114,20 @@ module Fog
{ :address => node.address, :port => node.port, :condition => node.condition, :weight => node.weight }
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