lib/cfnguardian/resources/base.rb in cfn-guardian-0.8.6 vs lib/cfnguardian/resources/base.rb in cfn-guardian-0.9.0
- old
+ new
@@ -18,17 +18,17 @@
@checks = []
@metric_filters = []
@event_subscriptions = []
end
- # Overidden by inheritted classes to define default alarms
+ # Overidden by inherited classes to define default alarms
def default_alarms()
return @alarms
end
def get_alarms(group,overides={})
- # deep copying the overrides to preserse it's reference before doing any changes to it
+ # deep copying the overrides to preserve its reference before doing any changes to it
overides = Marshal.load(Marshal.dump(overides))
# generate default alarms
default_alarms()
@@ -70,16 +70,16 @@
# Create a new alarm inheriting the defaults of an existing alarm
if properties.has_key?('Inherit')
alarm = find_alarm(properties['Inherit'])
if !alarm.nil?
logger.debug("creating new alarm #{name} for alarm group #{self.class.to_s.split('::').last} inheriting properties from alarm #{properties['Inherit']}")
- inheritited_alarm = alarm.clone
+ inherited_alarm = alarm.clone
alarm.name = name
- properties.each {|attr,value| update_object(inheritited_alarm,attr,value)}
- @alarms.push(inheritited_alarm)
+ properties.each {|attr,value| update_object(inherited_alarm,attr,value)}
+ @alarms.push(inherited_alarm)
else
- logger.warn "alarm '#{properties['Inherit']}' doesn't exists and cannot be inherited"
+ logger.warn "alarm '#{properties['Inherit']}' doesn't exist and cannot be inherited"
end
next
end
alarms = find_alarms(name)
@@ -122,53 +122,53 @@
end
return @alarms.select{|a| a.enabled}
end
- # Overidden by inheritted classes to define default events
+ # Overidden by inherited classes to define default events
def default_events()
return @events
end
def get_events()
default_events()
return @events.select{|e| e.enabled}
end
- # Overidden by inheritted classes to define default checks
+ # Overidden by inherited classes to define default checks
def default_checks()
return @checks
end
def get_checks()
default_checks()
return @checks
end
- # Overidden by inheritted classes to define default checks
+ # Overidden by inherited classes to define default checks
def default_metric_filters()
return @metric_filters
end
def get_metric_filters()
default_metric_filters()
return @metric_filters
end
- # Overidden by inheritted classes to define default checks
+ # Overidden by inherited classes to define default checks
def default_event_subscriptions()
return @event_subscriptions
end
def get_event_subscriptions(group, overides)
- # generate defailt event subscriptions
+ # generate default event subscriptions
default_event_subscriptions()
- # overide the defaults
+ # override the defaults
overides.each do |name, properties|
event_subscription = find_event_subscriptions(name)
- # disbable the event subscription if the value is false
+ # disable the event subscription if the value is false
if [false].include?(properties)
unless event_subscription.nil?
event_subscription.enabled = false
logger.info "Disabling event subscription #{name} for #{group} #{event_subscription.resource_id}"
end
\ No newline at end of file