flapjack 0.7.15 → 0.7.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
## Flapjack Changelog
|
2
2
|
|
3
|
+
# 0.7.16 - 2013-06-27
|
4
|
+
- Bug: errors accessing API gh-231 (@ali-graham)
|
5
|
+
|
3
6
|
# 0.7.15 - 2013-06-27
|
4
7
|
- Feature: Show acknowledgement duration on web interface, queryable via jabber gh-159 (@ali-graham)
|
5
8
|
- Feature: More info on check state in email gh-207 (@ali-graham)
|
@@ -722,7 +722,7 @@ module Flapjack
|
|
722
722
|
entity_check = find_entity_check(entity, check)
|
723
723
|
{:entity => entity_name,
|
724
724
|
:check => check,
|
725
|
-
result_type.to_sym => yield(Flapjack::Gateways::API::EntityCheckPresenter.new(entity_check
|
725
|
+
result_type.to_sym => yield(Flapjack::Gateways::API::EntityCheckPresenter.new(entity_check))
|
726
726
|
}
|
727
727
|
}
|
728
728
|
}.flatten(1)
|
@@ -26,9 +26,9 @@ module Flapjack
|
|
26
26
|
'in_unscheduled_maintenance' => @entity_check.in_unscheduled_maintenance?,
|
27
27
|
'in_scheduled_maintenance' => @entity_check.in_scheduled_maintenance?,
|
28
28
|
'last_update' => @entity_check.last_update,
|
29
|
-
'last_problem_notification' => entity_check.last_notification_for_state(:problem)[:timestamp],
|
30
|
-
'last_recovery_notification' => entity_check.last_notification_for_state(:recovery)[:timestamp],
|
31
|
-
'last_acknowledgement_notification' => entity_check.last_notification_for_state(:acknowledgement)[:timestamp]}
|
29
|
+
'last_problem_notification' => @entity_check.last_notification_for_state(:problem)[:timestamp],
|
30
|
+
'last_recovery_notification' => @entity_check.last_notification_for_state(:recovery)[:timestamp],
|
31
|
+
'last_acknowledgement_notification' => @entity_check.last_notification_for_state(:acknowledgement)[:timestamp]}
|
32
32
|
end
|
33
33
|
|
34
34
|
def outages(start_time, end_time, options = {})
|
@@ -51,6 +51,8 @@ module Flapjack
|
|
51
51
|
obj = hist_states[index]
|
52
52
|
index += 1
|
53
53
|
|
54
|
+
next if obj[:state] == 'ok'
|
55
|
+
|
54
56
|
if last_obj && (last_obj[:state] == obj[:state])
|
55
57
|
# TODO maybe build up arrays of these instead, and leave calling
|
56
58
|
# classes to join them together if needed?
|
@@ -59,8 +61,6 @@ module Flapjack
|
|
59
61
|
next
|
60
62
|
end
|
61
63
|
|
62
|
-
next if obj[:state] == 'ok'
|
63
|
-
|
64
64
|
ts = obj[:timestamp]
|
65
65
|
|
66
66
|
obj_st = (last_obj || !start_time) ? ts : [ts, start_time].max
|
data/lib/flapjack/version.rb
CHANGED
@@ -114,7 +114,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
114
114
|
entity_check_presenter.should_receive(:status).and_return(status)
|
115
115
|
|
116
116
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
117
|
-
with(entity_check
|
117
|
+
with(entity_check).and_return(entity_check_presenter)
|
118
118
|
|
119
119
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
120
120
|
with(entity, check, :redis => redis).and_return(entity_check)
|
@@ -182,7 +182,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
182
182
|
sched = mock('sched', :to_json => 'sched!'.to_json)
|
183
183
|
entity_check_presenter.should_receive(:scheduled_maintenances).with(nil, nil).and_return(sched)
|
184
184
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
185
|
-
with(entity_check
|
185
|
+
with(entity_check).and_return(entity_check_presenter)
|
186
186
|
Flapjack::Data::Entity.should_receive(:find_by_name).
|
187
187
|
with(entity_name, :redis => redis).and_return(entity)
|
188
188
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
@@ -226,7 +226,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
226
226
|
unsched = mock('unsched', :to_json => 'unsched!'.to_json)
|
227
227
|
entity_check_presenter.should_receive(:unscheduled_maintenances).with(nil, nil).and_return(unsched)
|
228
228
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
229
|
-
with(entity_check
|
229
|
+
with(entity_check).and_return(entity_check_presenter)
|
230
230
|
Flapjack::Data::Entity.should_receive(:find_by_name).
|
231
231
|
with(entity_name, :redis => redis).and_return(entity)
|
232
232
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
@@ -244,7 +244,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
244
244
|
unsched = mock('unsched', :to_json => 'unsched!'.to_json)
|
245
245
|
entity_check_presenter.should_receive(:unscheduled_maintenances).with(start.to_i, finish.to_i).and_return(unsched)
|
246
246
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
247
|
-
with(entity_check
|
247
|
+
with(entity_check).and_return(entity_check_presenter)
|
248
248
|
Flapjack::Data::Entity.should_receive(:find_by_name).
|
249
249
|
with(entity_name, :redis => redis).and_return(entity)
|
250
250
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
@@ -274,7 +274,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
274
274
|
out = mock('out', :to_json => 'out!'.to_json)
|
275
275
|
entity_check_presenter.should_receive(:outages).with(nil, nil).and_return(out)
|
276
276
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
277
|
-
with(entity_check
|
277
|
+
with(entity_check).and_return(entity_check_presenter)
|
278
278
|
Flapjack::Data::Entity.should_receive(:find_by_name).
|
279
279
|
with(entity_name, :redis => redis).and_return(entity)
|
280
280
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
@@ -303,7 +303,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
303
303
|
down = mock('down', :to_json => 'down!'.to_json)
|
304
304
|
entity_check_presenter.should_receive(:downtime).with(nil, nil).and_return(down)
|
305
305
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
306
|
-
with(entity_check
|
306
|
+
with(entity_check).and_return(entity_check_presenter)
|
307
307
|
Flapjack::Data::Entity.should_receive(:find_by_name).
|
308
308
|
with(entity_name, :redis => redis).and_return(entity)
|
309
309
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
@@ -362,7 +362,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
362
362
|
entity_check_presenter.should_receive(:status).and_return(status)
|
363
363
|
|
364
364
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
365
|
-
with(entity_check
|
365
|
+
with(entity_check).and_return(entity_check_presenter)
|
366
366
|
|
367
367
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
368
368
|
with(entity, check, :redis => redis).and_return(entity_check)
|
@@ -518,7 +518,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
518
518
|
entity_check_presenter.should_receive(:scheduled_maintenances).with(nil, nil).and_return(sm)
|
519
519
|
|
520
520
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
521
|
-
with(entity_check
|
521
|
+
with(entity_check).and_return(entity_check_presenter)
|
522
522
|
|
523
523
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
524
524
|
with(entity, check, :redis => redis).and_return(entity_check)
|
@@ -555,7 +555,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
555
555
|
entity_check_presenter.should_receive(:unscheduled_maintenances).with(nil, nil).and_return(um)
|
556
556
|
|
557
557
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
558
|
-
with(entity_check
|
558
|
+
with(entity_check).and_return(entity_check_presenter)
|
559
559
|
|
560
560
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
561
561
|
with(entity, check, :redis => redis).and_return(entity_check)
|
@@ -578,7 +578,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
578
578
|
entity_check_presenter.should_receive(:unscheduled_maintenances).with(start.to_i, finish.to_i).and_return(um)
|
579
579
|
|
580
580
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
581
|
-
with(entity_check
|
581
|
+
with(entity_check).and_return(entity_check_presenter)
|
582
582
|
|
583
583
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
584
584
|
with(entity, check, :redis => redis).and_return(entity_check)
|
@@ -618,9 +618,9 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
618
618
|
with(entity, :redis => redis).and_return(entity_presenter)
|
619
619
|
|
620
620
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
621
|
-
with(foo_check
|
621
|
+
with(foo_check).and_return(foo_check_presenter)
|
622
622
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
623
|
-
with(bar_check
|
623
|
+
with(bar_check).and_return(bar_check_presenter)
|
624
624
|
|
625
625
|
Flapjack::Data::Entity.should_receive(:find_by_name).
|
626
626
|
with(entity_name, :redis => redis).and_return(entity)
|
@@ -644,7 +644,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
644
644
|
entity_check_presenter.should_receive(:outages).with(nil, nil).and_return(outages)
|
645
645
|
|
646
646
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
647
|
-
with(entity_check
|
647
|
+
with(entity_check).and_return(entity_check_presenter)
|
648
648
|
|
649
649
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
650
650
|
with(entity, check, :redis => redis).and_return(entity_check)
|
@@ -681,7 +681,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
681
681
|
entity_check_presenter.should_receive(:downtime).with(nil, nil).and_return(downtime)
|
682
682
|
|
683
683
|
Flapjack::Gateways::API::EntityCheckPresenter.should_receive(:new).
|
684
|
-
with(entity_check
|
684
|
+
with(entity_check).and_return(entity_check_presenter)
|
685
685
|
|
686
686
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
687
687
|
with(entity, check, :redis => redis).and_return(entity_check)
|
@@ -735,7 +735,7 @@ describe 'Flapjack::Gateways::API', :sinatra => true, :logger => true, :json =>
|
|
735
735
|
entity_check.should_receive(:check).and_return(check)
|
736
736
|
Flapjack::Data::EntityCheck.should_receive(:for_entity).
|
737
737
|
with(entity, check, :redis => redis).and_return(entity_check)
|
738
|
-
|
738
|
+
|
739
739
|
Flapjack::Data::Event.should_receive(:test_notifications).
|
740
740
|
with(entity_name, check, hash_including(:redis => redis))
|
741
741
|
|
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: 0.7.
|
4
|
+
version: 0.7.16
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -553,7 +553,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
553
553
|
version: '0'
|
554
554
|
segments:
|
555
555
|
- 0
|
556
|
-
hash:
|
556
|
+
hash: -2341530797246933358
|
557
557
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
558
558
|
none: false
|
559
559
|
requirements:
|
@@ -562,7 +562,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
562
562
|
version: '0'
|
563
563
|
segments:
|
564
564
|
- 0
|
565
|
-
hash:
|
565
|
+
hash: -2341530797246933358
|
566
566
|
requirements: []
|
567
567
|
rubyforge_project:
|
568
568
|
rubygems_version: 1.8.23
|