nagira 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
data/History.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### v.0.2.8
2
+ * Wed Apr 17 2013 -- Dmytro Kovalov
3
+ - Bugfix - prevent tracedumps on nonexisting hostnames
4
+
1
5
  ### v.0.2.7
2
6
 
3
7
  * Mon Apr 15 2013 -- Dmytro Kovalov
data/Rakefile CHANGED
@@ -1,6 +1,16 @@
1
1
  require 'fileutils'
2
2
  require_relative 'lib/nagira'
3
3
 
4
+ # Release
5
+ # - rspec
6
+ # - run app, test
7
+ # - bump version
8
+ # - tag
9
+ # - gem build
10
+ # - gem install
11
+ # - tag push
12
+ # - gem push
13
+ #
4
14
  def log_user msg
5
15
  puts "#{Time.now} -- #{msg.chomp}"
6
16
  end
@@ -62,10 +62,12 @@ class Nagira < Sinatra::Base
62
62
 
63
63
 
64
64
  hostname = hostname.to_i if hostname =~ /^\d+$/
65
- if @output == :state
66
- @data = @status[hostname]['servicestatus'][service].slice("hostname", "service_description", "current_state")
67
- else
68
- @data = @status[hostname]['servicestatus'][service]
65
+ if @status && @status[hostname]
66
+ if @output == :state
67
+ @data = @status[hostname]['servicestatus'][service].slice("hostname", "service_description", "current_state")
68
+ else
69
+ @data = @status[hostname]['servicestatus'][service]
70
+ end
69
71
  end
70
72
  nil
71
73
  end
@@ -83,13 +85,15 @@ class Nagira < Sinatra::Base
83
85
  get "/_status/:hostname/_services" do |hostname|
84
86
 
85
87
  hostname = hostname.to_i if hostname =~ /^\d+$/
86
- case @output
87
- when :list
88
- @data = @status[hostname]['servicestatus'].keys
89
- when :state
90
- @data = @status.each { |k,v| @data[k] = v.slice("host_name", "service_description", "current_state") }
91
- else
92
- @data = @status[hostname]['servicestatus']
88
+ if @status && @status[hostname]
89
+ case @output
90
+ when :list
91
+ @data = @status[hostname]['servicestatus'].keys
92
+ when :state
93
+ @data = @status.each { |k,v| @data[k] = v.slice("host_name", "service_description", "current_state") }
94
+ else
95
+ @data = @status[hostname]['servicestatus']
96
+ end
93
97
  end
94
98
 
95
99
  nil
@@ -1 +1 @@
1
- 0.2.7
1
+ 0.2.8
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nagira
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-16 00:00:00.000000000 Z
12
+ date: 2013-04-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel