summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:10:32 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:10:32 +0000
commitfea454753efc4a673751131960c394254555d34a (patch)
tree47732a1c331c236f8f082dc4f6f5a6c6d6dab058 /bin
parentedf0e675123e4869e2739d1bab0ed57b3b9f664c (diff)
Don't use parenthesis aroudn conditions in an if.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/custodian-dequeue4
-rwxr-xr-xbin/custodian-enqueue6
-rwxr-xr-xbin/custodian-queue10
-rwxr-xr-xbin/multi-ping4
4 files changed, 12 insertions, 12 deletions
diff --git a/bin/custodian-dequeue b/bin/custodian-dequeue
index a411746..48dea57 100755
--- a/bin/custodian-dequeue
+++ b/bin/custodian-dequeue
@@ -136,7 +136,7 @@ if __FILE__ == $PROGRAM_NAME then
#
# Single step?
#
- if ( ENV['SINGLE'] )
+ if ENV['SINGLE']
worker.process_single_job
exit(0)
end
@@ -144,7 +144,7 @@ if __FILE__ == $PROGRAM_NAME then
#
# Run until we see a failure?
#
- if ( ENV['FAIL'] )
+ if ENV['FAIL']
worker.process_until_fail
exit(0)
end
diff --git a/bin/custodian-enqueue b/bin/custodian-enqueue
index 568c0d6..b1be84d 100755
--- a/bin/custodian-enqueue
+++ b/bin/custodian-enqueue
@@ -131,7 +131,7 @@ if __FILE__ == $PROGRAM_NAME then
#
settings = Custodian::Settings.instance
queue = Custodian::QueueType.create( settings.queue_type )
- if ( ! queue )
+ if ! queue
puts "Failed to connect to the #{settings.queue_type} queue"
exit 1
end
@@ -157,9 +157,9 @@ if __FILE__ == $PROGRAM_NAME then
mon.jobs.each do |test|
- if ( ENV['TEST'] )
+ if ENV['TEST']
# nop
- elsif ( ENV['DUMP'] )
+ elsif ENV['DUMP']
puts test
else
queue.add( test.to_s )
diff --git a/bin/custodian-queue b/bin/custodian-queue
index 9dec58a..66bf2ba 100755
--- a/bin/custodian-queue
+++ b/bin/custodian-queue
@@ -72,7 +72,7 @@ if __FILE__ == $PROGRAM_NAME then
opts.each do |opt, arg|
case opt
when "--monitor" then
- if ( arg )
+ if arg
$MONITOR = arg.to_i
else
$MONITOR = 5000
@@ -130,14 +130,14 @@ if __FILE__ == $PROGRAM_NAME then
#
# Alerting on a queue that is too-full?
#
- if ( !$MONITOR.nil? )
+ if !$MONITOR.nil?
#
# Find the number of jobs
#
jobs = queue.size?
- if ( jobs > $MONITOR )
+ if jobs > $MONITOR
exit 1
else
exit 0
@@ -148,7 +148,7 @@ if __FILE__ == $PROGRAM_NAME then
#
# Showing stats?
#
- if ( $STATS )
+ if $STATS
jobs = queue.size?
puts "There are #{jobs || 0} jobs pending."
exit( 0 )
@@ -158,7 +158,7 @@ if __FILE__ == $PROGRAM_NAME then
#
# Are we flushing the queue?
#
- if ( $FLUSH )
+ if $FLUSH
queue.flush!
end
diff --git a/bin/multi-ping b/bin/multi-ping
index 9833215..9760b35 100755
--- a/bin/multi-ping
+++ b/bin/multi-ping
@@ -105,7 +105,7 @@ hostname = ARGV.shift
#
# Abort if we don't have a hostname
#
-if ( hostname.nil? )
+if hostname.nil?
puts "Usage: #{$PROGRAM_NAME} hostname"
exit 1
end
@@ -121,7 +121,7 @@ helper = Custodian::Util::Ping.new( hostname )
#
# Ping the host, via the helper
#
-if ( helper.run_ping )
+if helper.run_ping
puts "#{hostname} - #{helper.address} - is alive."
exit 0
else