flapjack 1.2.1rc1 → 1.2.1rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile-ruby1.9.lock +1 -1
- data/lib/flapjack/cli/maintenance.rb +1 -0
- data/lib/flapjack/data/migration.rb +21 -9
- data/lib/flapjack/redis_pool.rb +2 -0
- data/lib/flapjack/version.rb +1 -1
- data/spec/lib/flapjack/redis_pool_spec.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c092ff47434ae5b8779b77e422ca2fbc3cec32df
|
4
|
+
data.tar.gz: 9c921600dc415ebb024ba5207571db063326e7fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85c23c132e45faea927de004b369a416fc7f88bc17e4ff6f682bede8a3493749731074fd6112f8bcac3142dfe283787f72526055d40929d618c62836fb99607f
|
7
|
+
data.tar.gz: 202737eae76714ffaee089982854ba0efe743a0f84fba9d30a3dc0bcf8bd370ee6c265d382051c7c9b49ff89dac9c17753da2cac09f03a05a8c63ae4a0107ada
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
## Flapjack Changelog
|
2
2
|
|
3
|
+
# 1.2.1rc2 - 2014-12-04
|
4
|
+
- Bug: Correct scheduled maintenance periods with expiry that don't match their timestamps #734 (@ali-graham)
|
5
|
+
|
3
6
|
# 1.2.1rc1 - 2014-12-04
|
4
7
|
- Bug: Exception in pagerduty gateway when looking for acknowledgements #721 (@jessereynolds)
|
5
8
|
- Bug: Retrieving scheduled maintenance via api fails when old entities without ids are present #711 (@jessereynolds)
|
data/Gemfile-ruby1.9.lock
CHANGED
@@ -68,6 +68,7 @@ module Flapjack
|
|
68
68
|
return @redis unless @redis.nil?
|
69
69
|
@redis = Redis.new(@redis_options.merge(:driver => :hiredis))
|
70
70
|
Flapjack::Data::Migration.migrate_entity_check_data_if_required(:redis => @redis)
|
71
|
+
Flapjack::Data::Migration.validate_scheduled_maintenance_periods(:redis => @redis)
|
71
72
|
@redis
|
72
73
|
end
|
73
74
|
|
@@ -32,11 +32,10 @@ module Flapjack
|
|
32
32
|
|
33
33
|
def self.create_entity_ids_if_required(options = {})
|
34
34
|
raise "Redis connection not set" unless redis = options[:redis]
|
35
|
+
|
35
36
|
logger = options[:logger]
|
36
37
|
|
37
|
-
if redis.exists('created_ids_for_old_entities_without_ids')
|
38
|
-
return
|
39
|
-
end
|
38
|
+
return if redis.exists('created_ids_for_old_entities_without_ids')
|
40
39
|
|
41
40
|
semaphore = obtain_semaphore(ENTITY_DATA_MIGRATION, :redis => redis)
|
42
41
|
if semaphore.nil?
|
@@ -71,9 +70,7 @@ module Flapjack
|
|
71
70
|
|
72
71
|
logger = options[:logger]
|
73
72
|
|
74
|
-
if redis.exists('all_checks')
|
75
|
-
return
|
76
|
-
end
|
73
|
+
return if redis.exists('all_checks')
|
77
74
|
|
78
75
|
semaphore = obtain_semaphore(ENTITY_DATA_MIGRATION, :redis => redis)
|
79
76
|
if semaphore.nil?
|
@@ -160,9 +157,7 @@ module Flapjack
|
|
160
157
|
|
161
158
|
logger = options[:logger]
|
162
159
|
|
163
|
-
if redis.exists('corrected_notification_rule_contact_linkages')
|
164
|
-
return
|
165
|
-
end
|
160
|
+
return if redis.exists('corrected_notification_rule_contact_linkages')
|
166
161
|
|
167
162
|
invalid_notification_rule_keys = redis.keys("notification_rule:*").select {|k|
|
168
163
|
contact_id = redis.hget(k, 'contact_id')
|
@@ -181,6 +176,23 @@ module Flapjack
|
|
181
176
|
redis.set('corrected_notification_rule_contact_linkages', 'true')
|
182
177
|
end
|
183
178
|
|
179
|
+
def self.validate_scheduled_maintenance_periods(options = {})
|
180
|
+
raise "Redis connection not set" unless redis = options[:redis]
|
181
|
+
|
182
|
+
logger = options[:logger]
|
183
|
+
|
184
|
+
return if redis.exists('validated_scheduled_maintenance_periods')
|
185
|
+
|
186
|
+
Flapjack::Data::EntityCheck.all(:redis => redis).select {|ec|
|
187
|
+
ec.in_scheduled_maintenance?
|
188
|
+
}.each do |check|
|
189
|
+
check.update_current_scheduled_maintenance(:revalidate => true)
|
190
|
+
end
|
191
|
+
|
192
|
+
logger.warn "Validated scheduled maintenance period expiry" unless logger.nil?
|
193
|
+
redis.set('validated_scheduled_maintenance_periods', 'true')
|
194
|
+
end
|
195
|
+
|
184
196
|
end
|
185
197
|
end
|
186
198
|
end
|
data/lib/flapjack/redis_pool.rb
CHANGED
@@ -28,6 +28,8 @@ module Flapjack
|
|
28
28
|
Flapjack::Data::Migration.create_entity_ids_if_required(:redis => redis,
|
29
29
|
:logger => logger)
|
30
30
|
Flapjack::Data::Migration.refresh_archive_index(:redis => redis)
|
31
|
+
Flapjack::Data::Migration.validate_scheduled_maintenance_periods(:redis => redis,
|
32
|
+
:logger => logger)
|
31
33
|
redis
|
32
34
|
}
|
33
35
|
end
|
data/lib/flapjack/version.rb
CHANGED
@@ -16,6 +16,7 @@ describe Flapjack::RedisPool do
|
|
16
16
|
expect(Flapjack::Data::Migration).to receive(:migrate_entity_check_data_if_required).exactly(redis_count).times
|
17
17
|
expect(Flapjack::Data::Migration).to receive(:create_entity_ids_if_required).exactly(redis_count).times
|
18
18
|
expect(Flapjack::Data::Migration).to receive(:refresh_archive_index).exactly(redis_count).times
|
19
|
+
expect(Flapjack::Data::Migration).to receive(:validate_scheduled_maintenance_periods).exactly(redis_count).times
|
19
20
|
|
20
21
|
frp = Flapjack::RedisPool.new(:size => redis_count)
|
21
22
|
|