mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 10:28:41 -05:00
(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:
parent
f580f9915e
commit
38f962f514
4 changed files with 13 additions and 35 deletions
|
|
@ -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']
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue