lib/chef-workflow/support/scheduler.rb
#
# This method determines what 'waiters', or provisioners that cannot
# provision yet because of unresolved dependencies, can be executed.
#
This method determines what 'waiters', or provisioners that cannot
provision yet because of unresolved dependencies, can be executed.
This method determines what ' waiters ' or provisioners that cannot provision yet because of unresolved dependencies can be executed .
def service_resolved_waiters
    @waiters -= (@working.keys.to_set + solved)
    @waiters.each do |group_name|
      if solved & vm_dependencies[group_name] == vm_dependencies[group_name]
        if_debug do
          $stderr.puts "Provisioning #{group_name}"
        end
        provisioner = vm_groups[group_name]
        provision_block = lambda do
          args = nil
          provisioner.each do |this_prov|
            unless args = this_prov.startup(args)
              raise "Could not provision #{group_name}"
            end
          end
          @queue << group_name
        end
        vm_working.add(group_name)
        if @serial
          @working[group_name] = Thread.new { sleep }
          provision_block.call
        else
          @working[group_name] = Thread.new(&provision_block)
        end
      end
    end
  end
def service_resolved_waiters @waiters -= ( @working . keys . to_set + solved ) @waiters . each do | group_name | if solved & vm_dependencies [ group_name ] == vm_dependencies [ group_name ] if_debug do $stderr . puts "Provisioning #{group_name}" end provisioner = vm_groups [ group_name ] provision_block = lambda do args = nil provisioner . each do | this_prov | unless args = this_prov . startup ( args ) raise "Could not provision #{group_name}" end end @queue << group_name end vm_working . add ( group_name ) if @serial @working [ group_name ] = Thread . new { sleep } provision_block . call else @working [ group_name ] = Thread . new ( & provision_block ) end end end end
This method determines what 'waiters', or provisioners that cannot
provision yet because of unresolved dependencies, can be executed.
This method determines what ' waiters ' or provisioners that cannot provision yet because of unresolved dependencies can be executed .
# FIXME maybe a way to specify initial args? # HACK: just give the working check something that will always work. #       Probably should just mock it.