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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1038ee80ed4a85514dbe214c5a50768c3517db8e
4
- data.tar.gz: 6373cd02ed2d57411ed732bb1b00eb3e449b6683
3
+ metadata.gz: c092ff47434ae5b8779b77e422ca2fbc3cec32df
4
+ data.tar.gz: 9c921600dc415ebb024ba5207571db063326e7fc
5
5
  SHA512:
6
- metadata.gz: 4ebdf21010802ae6ff6cd737e0ca6be03428fbafd6cc7dd31a65da6fc8fe821c3bd35a375e5a2b0a05ea92a438fdd0e2909b5f6f65ff69a99d1eb5daabc78c7c
7
- data.tar.gz: 91d761e805b496c781596559c1d32465c875208db46365c31f60e04b19c89ef34faf3d3e0adac3425149d02421433699b8f1b1adcd3fd0b19437f063bbcbe3ba
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flapjack (1.2.1rc1)
4
+ flapjack (1.2.1rc2)
5
5
  activesupport (~> 3.2.14)
6
6
  blather (~> 0.8.3)
7
7
  chronic
@@ -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
@@ -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
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  module Flapjack
4
- VERSION = "1.2.1rc1"
4
+ VERSION = "1.2.1rc2"
5
5
  end
6
6
 
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flapjack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1rc1
4
+ version: 1.2.1rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindsay Holmwood