app/models/logical/naf/construction_zone/boss.rb in naf-2.0.4 vs app/models/logical/naf/construction_zone/boss.rb in naf-2.1.0

- old
+ new

@@ -78,16 +78,15 @@ end def enqueue_n_commands_on_machines(parameters, number_of_jobs = :from_limit, machines = []) logger.detail "enqueuing #{parameters[:command]} #{number_of_jobs} time(s) on #{machines.length} machine(s)" machines.each do |machine| - number_of_jobs = (parameters[:application_run_group_limit] || 1) if number_of_jobs == :from_limit + number_of_jobs = (parameters[:application_run_group_quantum] || 1) if number_of_jobs == :from_limit logger.info "enqueuing #{parameters[:command]} #{number_of_jobs} time(s) on #{machine}" (1..number_of_jobs).each do machine_parameters = { - :application_run_group_limit => number_of_jobs, - :application_run_group_restriction => ::Naf::ApplicationRunGroupRestriction.limited_per_machine + application_run_group_restriction: ::Naf::ApplicationRunGroupRestriction.limited_per_machine }.merge(parameters) machine_parameters[:affinities] = [machine.affinity] + if machine_parameters[:affinities].nil? [] elsif machine_parameters[:affinities].is_a? Array @@ -100,13 +99,13 @@ end end end def enqueue_n_commands(parameters, number_of_jobs = :from_limit) - number_of_jobs = (parameters[:application_run_group_limit] || 1) if number_of_jobs == :from_limit + number_of_jobs = (parameters[:application_run_group_quantum] || 1) if number_of_jobs == :from_limit logger.info "enqueuing #{parameters[:command]} #{number_of_jobs} time(s) on #{machine}" (1..number_of_jobs).each do - work_order = AdHocWorkOrder.new({:application_run_group_limit => number_of_jobs}.merge(parameters)) + work_order = AdHocWorkOrder.new(parameters) @foreman.enqueue(work_order) end end def reenqueue(job)