summaryrefslogtreecommitdiff
path: root/lib/custodian/alerts/redis-state.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2016-04-22 21:54:18 +0300
committerSteve Kemp <steve@steve.org.uk>2016-04-22 21:54:18 +0300
commit85a9a63eb5d8690fd7945bba901b10ef8c3326c9 (patch)
tree7d19fa2c6f951ad9c2537f75c397a9adb94e7372 /lib/custodian/alerts/redis-state.rb
parent67fbf68705e1808107e8cea1d3ab6ad0e206f645 (diff)
More rubocop fixes.
Diffstat (limited to 'lib/custodian/alerts/redis-state.rb')
-rw-r--r--lib/custodian/alerts/redis-state.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/custodian/alerts/redis-state.rb b/lib/custodian/alerts/redis-state.rb
index 793bb73..2008fee 100644
--- a/lib/custodian/alerts/redis-state.rb
+++ b/lib/custodian/alerts/redis-state.rb
@@ -71,7 +71,7 @@ module Custodian
puts 'ERROR Loading redis rubygem!'
end
- @test = obj
+ @test = obj
end
@@ -88,7 +88,7 @@ module Custodian
#
test_s = @test.to_s
- @redis.sadd( "known_tests", test_s )
+ @redis.sadd('known_tests', test_s)
#
# Get the current state of this test - so that if the state
@@ -101,16 +101,16 @@ module Custodian
#
# The current state
#
- current = @redis.get( "#{key}.current" ) || "unknown"
- @redis.set( "#{key}.current", "FAIL" )
+ current = @redis.get("#{key}.current") || 'unknown'
+ @redis.set("#{key}.current", 'FAIL')
- count = @redis.get( "#{key}.count" ) || "0"
- @redis.set( "#{key}.count", (count.to_i + 1))
+ count = @redis.get("#{key}.count") || '0'
+ @redis.set("#{key}.count", (count.to_i + 1))
#
# Bump the execution count for this test.
#
- if ( current != "FAIL" )
+ if (current != 'FAIL')
#
# The state has changed to raise.
@@ -120,7 +120,7 @@ module Custodian
tmp['result'] = 'FAIL'
tmp['reason'] = @test.error
- @redis.lpush( "#{key}.history", tmp.to_json)
+ @redis.lpush("#{key}.history", tmp.to_json)
@redis.ltrim('#{key}.history', 0, 8192)
end
@@ -140,7 +140,7 @@ module Custodian
#
test_s = @test.to_s
- @redis.sadd( "known_tests", test_s )
+ @redis.sadd('known_tests', test_s)
#
# Get the current state of this test - so that if the state
@@ -153,13 +153,13 @@ module Custodian
#
# The current state
#
- current = @redis.get( "#{key}.current" ) || "unknown"
- @redis.set( "#{key}.current", "OK" )
+ current = @redis.get("#{key}.current") || 'unknown'
+ @redis.set("#{key}.current", 'OK')
- count = @redis.get( "#{key}.count" ) || "0"
- @redis.set( "#{key}.count", (count.to_i + 1 ))
+ count = @redis.get("#{key}.count") || '0'
+ @redis.set("#{key}.count", (count.to_i + 1))
- if ( current != "OK" )
+ if (current != 'OK')
#
# The state has changed to raise.
@@ -169,7 +169,7 @@ module Custodian
tmp['result'] = 'OK'
tmp['reason'] = @test.error
- @redis.lpush( "#{key}.history", tmp.to_json)
+ @redis.lpush("#{key}.history", tmp.to_json)
@redis.ltrim('#{key}.history', 0, 100)
end
end