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:
commit
3f6520b111
1 changed files with 3 additions and 2 deletions
|
@ -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']
|
||||||
|
|
Loading…
Reference in a new issue