[elb] cleanup

This commit is contained in:
geemus 2010-05-02 13:25:14 -07:00
parent 70f120af47
commit 0e90decc4e
2 changed files with 11 additions and 5 deletions

View File

@ -44,14 +44,14 @@ module Fog
@aws_secret_access_key = options[:aws_secret_access_key]
@hmac = HMAC::SHA256.new(@aws_secret_access_key)
@host = options[:host] || case options[:region]
when 'ap-southeast-1'
'elasticloadbalancing.ap-southeast-1.amazonaws.com'
when 'eu-west-1'
'elasticloadbalancing.eu-west-1.amazonaws.com'
when 'us-east-1'
'elasticloadbalancing.us-east-1.amazonaws.com'
when 'us-west-1'
'elasticloadbalancing.us-west-1.amazonaws.com'
when 'ap-southeast-1'
'elasticloadbalancing.ap-southeast-1.amazonaws.com'
else
'elasticloadbalancing.amazonaws.com'
end

View File

@ -36,9 +36,7 @@ module Fog
# * 'AvailabilityZones'<~Array> - list of availability zones covered by this load balancer
# * 'Instances'<~Array> - list of instances that the load balancer balances between
def describe_load_balancers(lb_name = [])
lb_name = [lb_name] if lb_name.instance_of?(String)
lb_name.unshift(nil)
params = AWS.indexed_param('LoadBalancerNames.member', lb_name)
params = AWS.indexed_param('LoadBalancerNames.member', [*lb_name])
request({
'Action' => 'DescribeLoadBalancers',
:parser => Fog::Parsers::AWS::ELB::DescribeLoadBalancers.new
@ -46,6 +44,14 @@ module Fog
end
end
class Mock
def describe_load_balancers(lb_name = [])
raise MockNotImplemented.new("Contributions welcome!")
end
end
end
end
end