bin/check-redshift-events.rb in sensu-plugins-aws-10.1.1 vs bin/check-redshift-events.rb in sensu-plugins-aws-10.1.2
- old
+ new
@@ -79,11 +79,11 @@
@clusters ||= redshift.describe_clusters[:clusters].map { |c| c[:cluster_identifier] }
end
# throw unknown message if the user passed us a missing instance
def check_missing_instances(instances)
- missing_instances = instances.select { |i| !all_clusters.include?(i) }
+ missing_instances = instances.reject { |i| all_clusters.include?(i) }
unknown("Passed instance(s): #{missing_instances.join(',')} not found") unless missing_instances.empty?
end
# return an array of clusters that are in maintenance
def clusters_in_maint(clusters)
@@ -108,10 +108,10 @@
check_missing_instances(config[:instances])
all_clusters.select! { |c| config[:instances].include?(c) }
end
maint_clusters = clusters_in_maint(all_clusters)
- rescue => e
+ rescue StandardError => e
unknown "An error occurred processing AWS Redshift API: #{e.message}"
end
if maint_clusters.empty?
ok