mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws|auto_scaling] DRY out ARNs in mocks.
This commit is contained in:
parent
3306eaf765
commit
a5701e9e19
4 changed files with 6 additions and 5 deletions
|
@ -240,6 +240,7 @@ module Fog
|
|||
@use_iam_profile = options[:use_iam_profile]
|
||||
setup_credentials(options)
|
||||
@region = options[:region] || 'us-east-1'
|
||||
@owner_id = Fog::AWS::Mock.owner_id
|
||||
|
||||
unless ['ap-northeast-1', 'ap-southeast-1', 'eu-west-1', 'sa-east-1', 'us-east-1', 'us-west-1', 'us-west-2'].include?(@region)
|
||||
raise ArgumentError, "Unknown region: #{@region.inspect}"
|
||||
|
@ -248,7 +249,7 @@ module Fog
|
|||
end
|
||||
|
||||
def setup_credentials(options)
|
||||
@aws_access_key_id = options[:aws_access_key_id]
|
||||
@aws_access_key_id = options[:aws_access_key_id]
|
||||
end
|
||||
|
||||
def data
|
||||
|
|
|
@ -88,7 +88,7 @@ module Fog
|
|||
raise Fog::AWS::AutoScaling::ValidationError.new('Launch configuration name not found - null')
|
||||
end
|
||||
data[:auto_scaling_groups][auto_scaling_group_name] = {
|
||||
'AutoScalingGroupARN' => "arn:aws:autoscaling:eu-west-1:000000000000:autoScalingGroup:00000000-0000-0000-0000-000000000000:autoScalingGroupName/#{auto_scaling_group_name}",
|
||||
'AutoScalingGroupARN' => Fog::AWS::Mock.arn('autoscaling', @owner_id, "autoScalingGroup:00000000-0000-0000-0000-000000000000:autoScalingGroupName/#{auto_scaling_group_name}", @region),
|
||||
'AutoScalingGroupName' => launch_configuration_name,
|
||||
'AvailabilityZones' => availability_zones.to_a,
|
||||
'CreatedTime' => Time.now.utc,
|
||||
|
|
|
@ -90,7 +90,7 @@ module Fog
|
|||
'InstanceType' => instance_type,
|
||||
'KernelId' => nil,
|
||||
'KeyName' => nil,
|
||||
'LaunchConfigurationARN' => "arn:aws:autoscaling:eu-west-1:000000000000:launchConfiguration:00000000-0000-0000-0000-000000000000:launchConfigurationName/#{launch_configuration_name}",
|
||||
'LaunchConfigurationARN' => Fog::AWS::Mock.arn('autoscaling', @owner_id, "launchConfiguration:00000000-0000-0000-0000-000000000000:launchConfigurationName/#{launch_configuration_name}", @region),
|
||||
'LaunchConfigurationName' => launch_configuration_name,
|
||||
'RamdiskId' => nil,
|
||||
'SecurityGroups' => [],
|
||||
|
|
|
@ -46,7 +46,7 @@ module Fog
|
|||
'AdjustmentType' => adjustment_type,
|
||||
'AutoScalingGroupName' => auto_scaling_group_name,
|
||||
'PolicyName' => policy_name,
|
||||
'ScalingAdjustment' => scaling_adjustment,
|
||||
'ScalingAdjustment' => scaling_adjustment,
|
||||
:parser => Fog::Parsers::AWS::AutoScaling::PutScalingPolicy.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
@ -65,7 +65,7 @@ module Fog
|
|||
'AutoScalingGroupName' => auto_scaling_group_name,
|
||||
'Cooldown' => 0,
|
||||
'MinAdjustmentStep' => 0,
|
||||
'PolicyARN' => "arn:aws:autoscaling:eu-west-1:000000000000:scalingPolicy:00000000-0000-0000-0000-000000000000:autoScalingGroupName/#{auto_scaling_group_name}:policyName/#{policy_name}",
|
||||
'PolicyARN' => Fog::AWS::Mock.arn('autoscaling', @owner_id, "scalingPolicy:00000000-0000-0000-0000-000000000000:autoScalingGroupName/#{auto_scaling_group_name}:policyName/#{policy_name}", @region),
|
||||
'PolicyName' => policy_name,
|
||||
'ScalingAdjustment' => scaling_adjustment
|
||||
}.merge!(options)
|
||||
|
|
Loading…
Reference in a new issue