lib/beaker/network_manager.rb in beaker-3.13.0 vs lib/beaker/network_manager.rb in beaker-3.14.0
- old
+ new
@@ -19,10 +19,12 @@
command_line_says = options[:provision]
host_says = host['hypervisor'] && (host.has_key?('provision') ? host['provision'] : true)
(command_line_says && host_says) or (host['hypervisor'] =~/(vagrant|docker)/)
end
+ attr_accessor :hosts, :hypervisors
+
def initialize(options, logger)
@logger = logger
@options = options
@hosts = []
@machines = {}
@@ -54,10 +56,12 @@
#sort hosts by their hypervisor, use hypervisor 'none' if no hypervisor is specified
hostless_options = Beaker::Options::OptionsHash.new.merge(@options.select{ |k,v| k.to_s !~ /HOSTS/})
@options['HOSTS'].each_key do |name|
host_hash = @options['HOSTS'][name]
hypervisor = host_hash['hypervisor']
- hypervisor = provision?(@options, host_hash) ? host_hash['hypervisor'] : 'none'
+ if @options[:provision]
+ hypervisor = provision?(@options, host_hash) ? host_hash['hypervisor'] : 'none'
+ end
@logger.debug "Hypervisor for #{name} is #{hypervisor}"
@machines[hypervisor] = [] unless @machines[hypervisor]
hostless_options[:timesync] = host_hash[:timesync] if host_hash[:timesync]!=nil
host_itself = Beaker::Host.create(name, host_hash, hostless_options)
host_itself.validate_setup