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
|
@ -27,7 +27,7 @@ module Fog
|
|||
params = Fog::AWS.indexed_param('AvailabilityZones.member', [*availability_zones])
|
||||
params.merge!(Fog::AWS.indexed_param('Subnets.member.%d', options[:subnet_ids]))
|
||||
params.merge!(Fog::AWS.serialize_keys('Scheme', options[:scheme]))
|
||||
params.merge!(Fog::AWS.indexed_param('SecurityGroups.member.%d', options[:security_groups]))
|
||||
params.merge!(Fog::AWS.indexed_param('SecurityGroups.member.%d', options[:security_groups]))
|
||||
|
||||
listener_protocol = []
|
||||
listener_lb_port = []
|
||||
|
@ -74,7 +74,8 @@ module Fog
|
|||
|
||||
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"]
|
||||
security_group = if supported_platforms.include?("EC2")
|
||||
Fog::Compute::AWS::Mock.data[region][@aws_access_key_id][:security_groups]['amazon-elb-sg']
|
||||
|
|
Loading…
Reference in a new issue