mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Use ruby-style attribute setters in AutoScaling::Group initializer
This commit is contained in:
parent
fa5d270915
commit
ef47f6316e
2 changed files with 17 additions and 12 deletions
|
@ -25,18 +25,18 @@ module Fog
|
|||
attribute :vpc_zone_identifier, :aliases => 'VPCZoneIdentifier'
|
||||
|
||||
def initialize(attributes={})
|
||||
attributes['DefaultCooldown'] ||= 300
|
||||
attributes['DesiredCapacity'] ||= 0
|
||||
attributes['EnabledMetrics'] ||= []
|
||||
attributes['HealthCheckGracePeriod'] ||= 0
|
||||
attributes['HealthCheckType'] ||= 'EC2'
|
||||
attributes['Instances'] ||= []
|
||||
attributes['LoadBalancerNames'] ||= []
|
||||
attributes['MaxSize'] ||= 0
|
||||
attributes['MinSize'] ||= 0
|
||||
attributes['SuspendedProcesses'] ||= []
|
||||
attributes['Tags'] ||= []
|
||||
attributes['TerminationPolicies'] ||= ['Default']
|
||||
attributes['Instances'] = []
|
||||
self.default_cooldown = 300
|
||||
self.desired_capacity = 0
|
||||
self.enabled_metrics = []
|
||||
self.health_check_grace_period = 0
|
||||
self.health_check_type = 'EC2'
|
||||
self.load_balancer_names = []
|
||||
self.max_size = 0
|
||||
self.min_size = 0
|
||||
self.suspended_processes = []
|
||||
self.tags = []
|
||||
self.termination_policies = ['Default']
|
||||
super
|
||||
end
|
||||
|
||||
|
|
|
@ -19,4 +19,9 @@ Shindo.tests('AWS::AutoScaling | group', ['aws', 'auto_scaling_m']) do
|
|||
@instance.update
|
||||
end
|
||||
|
||||
test("setting attributes in the constructor") do
|
||||
group = Fog::AWS[:auto_scaling].groups.new(min_size: 1, max_size: 2)
|
||||
group.min_size == 1 && group.max_size == 2
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue