(MAINT) Rename New Port Config

Rename port to check_pending_port and port_timeout to
check_pending_timeout.

The default settings have also been moved to a location where other
defaults are being set.
This commit is contained in:
Colin 2015-12-21 11:54:22 -08:00
parent f580f9915e
commit 38f962f514
4 changed files with 13 additions and 35 deletions

View file

@ -33,6 +33,9 @@ module Vmpooler
parsed_config[:config]['vm_checktime'] ||= 15
parsed_config[:config]['vm_lifetime'] ||= 24
parsed_config[:config]['check_pending_port'] ||= 22
parsed_config[:config]['check_pending_timeout'] ||= 5
# Create an index of pool aliases
parsed_config[:pools].each do |pool|
if pool['alias']

View file

@ -1,12 +1,6 @@
module Vmpooler
class PoolManager
# Defaults
# port number to verify pending VM is ready
DEFAULT_PORT_NO = 22
# timeout, in seconds, when connecting to DEFAULT_PORT_NO
DEFAULT_PORT_TIMEOUT = 5
def initialize(config, logger, redis, graphite=nil)
$config = config
@ -39,8 +33,8 @@ module Vmpooler
if host
begin
Timeout.timeout($config[:config]['port_timeout'] || DEFAULT_PORT_TIMEOUT) do
TCPSocket.new vm, ($config[:config]['port'] || DEFAULT_PORT_NO)
Timeout.timeout($config[:config]['check_pending_timeout']) do
TCPSocket.new vm, $config[:config]['check_pending_port']
end
move_pending_vm_to_ready(vm, pool, host)
rescue