mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
This commit fixes the many rubocop offenses. Also modifies the rubocop settings: - Set max method params higher than the default of 5 - Ignore Style/GuardClause. In some cases it's eaiser to read without the guard - Renamed a cop
36 lines
729 B
Ruby
Executable file
36 lines
729 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
|
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
|
|
require 'rubygems' unless defined?(Gem)
|
|
require 'lib/vmpooler'
|
|
|
|
config = Vmpooler.config
|
|
redis_host = config[:redis]['server']
|
|
logger_file = config[:config]['logfile']
|
|
|
|
metrics = Vmpooler.new_metrics(config)
|
|
|
|
api = Thread.new do
|
|
thr = Vmpooler::API.new
|
|
thr.helpers.configure(config, Vmpooler.new_redis(redis_host), metrics)
|
|
thr.helpers.execute!
|
|
end
|
|
|
|
manager = Thread.new do
|
|
Vmpooler::PoolManager.new(
|
|
config,
|
|
Vmpooler.new_logger(logger_file),
|
|
Vmpooler.new_redis(redis_host),
|
|
metrics
|
|
).execute!
|
|
end
|
|
|
|
if ENV['VMPOOLER_DEBUG']
|
|
trap('INT') do
|
|
puts 'Shutting down.'
|
|
[api, manager].each(&:exit)
|
|
end
|
|
end
|
|
|
|
[api, manager].each(&:join)
|