Skip to content

Commit

Permalink
check if all the params are provided before doing anything
Browse files Browse the repository at this point in the history
  • Loading branch information
honza committed Aug 10, 2016
1 parent 4f7b824 commit 17a9e4a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions check_rabbitmq-sync.rb
Expand Up @@ -37,15 +37,13 @@ def usage(optparse)

optparse.parse!

if options[:host] !~ /^https?:\/\/.*/
options[:host] = 'http://' + options[:host]
end


if options[:host].nil? or options[:user].nil? or options[:password].nil? or options[:vhost].nil? or options[:port].nil?
usage(optparse)
end

if options[:host] !~ /^https?:\/\/.*/
options[:host] = 'http://' + options[:host]
end

begin
uri = URI::parse("#{options[:host]}:#{options[:port]}/api/queues/#{options[:vhost]}")
Expand Down

0 comments on commit 17a9e4a

Please sign in to comment.