1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #2500 from josacar/master

[aws|elb] Mimic real behavior in create_load_balancer mock
This commit is contained in:
Wesley Beary 2013-12-23 07:08:46 -08:00
commit 3f6520b111

View file

@ -74,7 +74,8 @@ module Fog
dns_name = Fog::AWS::ELB::Mock.dns_name(lb_name, @region) dns_name = Fog::AWS::ELB::Mock.dns_name(lb_name, @region)
region = availability_zones ? availability_zones.first.gsub(/[a-z]$/, '') : "us-east-1" availability_zones = [*availability_zones]
region = availability_zones.empty? ? "us-east-1" : availability_zones.first.gsub(/[a-z]$/, '')
supported_platforms = Fog::Compute::AWS::Mock.data[region][@aws_access_key_id][:account_attributes].detect { |h| h["attributeName"] == "supported-platforms" }["values"] supported_platforms = Fog::Compute::AWS::Mock.data[region][@aws_access_key_id][:account_attributes].detect { |h| h["attributeName"] == "supported-platforms" }["values"]
security_group = if supported_platforms.include?("EC2") security_group = if supported_platforms.include?("EC2")
Fog::Compute::AWS::Mock.data[region][@aws_access_key_id][:security_groups]['amazon-elb-sg'] Fog::Compute::AWS::Mock.data[region][@aws_access_key_id][:security_groups]['amazon-elb-sg']