diff --git a/app/models/infra_conversion_job.rb b/app/models/infra_conversion_job.rb index 1323091c8a2..26d7bb24ad8 100644 --- a/app/models/infra_conversion_job.rb +++ b/app/models/infra_conversion_job.rb @@ -239,17 +239,7 @@ def polling_timeout end def queue_signal(*args, deliver_on: nil) - MiqQueue.put( - :class_name => self.class.name, - :method_name => "signal", - :instance_id => id, - :role => "ems_operations", - :zone => zone, - :task_id => guid, - :args => args, - :deliver_on => deliver_on, - :server_guid => MiqServer.my_server.guid - ) + super(*args, :role => "ems_operations", :deliver_on => deliver_on, :server_guid => MiqServer.my_server.guid) end def prep_message(contents) diff --git a/app/models/job/state_machine.rb b/app/models/job/state_machine.rb index 25a5176bc71..ea16621f364 100644 --- a/app/models/job/state_machine.rb +++ b/app/models/job/state_machine.rb @@ -36,4 +36,19 @@ def signal(signal, *args) raise _("%{signal} is not permitted at state %{state}") % {:signal => signal, :state => state} end end + + def queue_signal(*args, priority: MiqQueue::NORMAL_PRIORITY, role: nil, deliver_on: nil, server_guid: nil) + MiqQueue.put( + :class_name => self.class.name, + :method_name => "signal", + :instance_id => id, + :priority => priority, + :role => role, + :zone => zone, + :task_id => guid, + :args => args, + :deliver_on => deliver_on, + :server_guid => server_guid + ) + end end diff --git a/app/models/manageiq/providers/ansible_runner_workflow.rb b/app/models/manageiq/providers/ansible_runner_workflow.rb index f60747cd7bb..df60c686c9e 100644 --- a/app/models/manageiq/providers/ansible_runner_workflow.rb +++ b/app/models/manageiq/providers/ansible_runner_workflow.rb @@ -95,18 +95,7 @@ def queue_signal(*args, deliver_on: nil) role = options[:role] || "ems_operations" priority = options[:priority] || MiqQueue::NORMAL_PRIORITY - MiqQueue.put( - :class_name => self.class.name, - :method_name => "signal", - :instance_id => id, - :priority => priority, - :role => role, - :zone => zone, - :task_id => guid, - :args => args, - :deliver_on => deliver_on, - :server_guid => MiqServer.my_server.guid - ) + super(*args, :priority => priority, :role => role, :deliver_on => deliver_on, :server_guid => MiqServer.my_server.guid) end def deliver_on diff --git a/app/models/manageiq/providers/embedded_ansible/automation_manager/playbook_runner.rb b/app/models/manageiq/providers/embedded_ansible/automation_manager/playbook_runner.rb index 88ca774a151..91b864df0df 100644 --- a/app/models/manageiq/providers/embedded_ansible/automation_manager/playbook_runner.rb +++ b/app/models/manageiq/providers/embedded_ansible/automation_manager/playbook_runner.rb @@ -153,15 +153,7 @@ def my_signal(no_queue, action, *args, deliver_on: nil) def queue_signal(*args, deliver_on: nil) priority = options[:priority] || MiqQueue::NORMAL_PRIORITY - MiqQueue.put( - :class_name => self.class.name, - :method_name => "signal", - :instance_id => id, - :priority => priority, - :role => 'embedded_ansible', - :args => args, - :deliver_on => deliver_on - ) + super(*args, :priority => priority, :role => "embedded_ansible", :deliver_on => deliver_on) end def temp_configuration_script diff --git a/app/models/manageiq/providers/ems_refresh_workflow.rb b/app/models/manageiq/providers/ems_refresh_workflow.rb index bc61b7b6ba1..d4a358da0b1 100644 --- a/app/models/manageiq/providers/ems_refresh_workflow.rb +++ b/app/models/manageiq/providers/ems_refresh_workflow.rb @@ -58,17 +58,7 @@ def queue_signal(*args, deliver_on: nil) role = options[:role] || "ems_operations" priority = options[:priority] || MiqQueue::NORMAL_PRIORITY - MiqQueue.put( - :class_name => self.class.name, - :method_name => "signal", - :instance_id => id, - :priority => priority, - :role => role, - :zone => zone, - :task_id => guid, - :args => args, - :deliver_on => deliver_on - ) + super(*args, :role => role, :priority => priority, :deliver_on => deliver_on) end alias_method :initializing, :dispatch_start