Skip to content

Commit

Permalink
Merge pull request #22614 from agrare/fix_workflows_queue_operations
Browse files Browse the repository at this point in the history
Fix workflows operations queued on embedded_ansible

(cherry picked from commit e3c3d28)
  • Loading branch information
kbrock authored and Fryguy committed Jul 25, 2023
1 parent f969370 commit 4b47a1a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def self.notify_on_provider_interaction?
true
end

private_class_method def self.queue_role
"embedded_ansible"
end

def sync
update!(:status => "running")
transaction do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Credential < ManageIQ::Providers::EmbeddedAutomationManager::Authentication
FRIENDLY_NAME = "Embedded Ansible Credential".freeze

private_class_method def self.queue_role
"embedded_ansible"
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def queue(instance_id, method_name, args, action, auth_user)
:priority => MiqQueue::HIGH_PRIORITY,
:class_name => name,
:method_name => method_name,
:role => "embedded_ansible",
:role => queue_role,
:zone => nil
}
queue_opts[:instance_id] = instance_id if instance_id
Expand Down Expand Up @@ -58,6 +58,10 @@ def create_in_provider_queue(manager_id, params, auth_user = nil)

private

def queue_role
nil
end

def send_notification(op_type, manager_id, params, success)
op_arg = params.except(*notification_excludes).collect { |k, v| "#{k}=#{v}" }.join(', ')
_log.send(success ? :info : :error, "#{name} #{op_type} with parameters: #{op_arg.inspect} #{success ? 'succeeded' : 'failed'}")
Expand Down

0 comments on commit 4b47a1a

Please sign in to comment.