Class: ForemanAnsibleDirector::Issues::Warnings::NoResolutionCandidateForRole

Inherits:
BaseWarning
  • Object
show all
Defined in:
app/lib/foreman_ansible_director/issues/warnings/no_resolution_candidate_for_role.rb

Instance Method Summary collapse

Methods inherited from BaseIssue

#render_for_logs

Constructor Details

#initialize(role_namespace:, role_name:, content_source:, assignment_id:) ⇒ NoResolutionCandidateForRole

Returns a new instance of NoResolutionCandidateForRole.



7
8
9
10
11
12
13
14
15
16
# File 'app/lib/foreman_ansible_director/issues/warnings/no_resolution_candidate_for_role.rb', line 7

def initialize(role_namespace:,
               role_name:,
               content_source:,
               assignment_id:)
  @role_namespace = role_namespace
  @role_name = role_name
  @content_source = content_source
  @assignment_id = assignment_id
  super
end

Instance Method Details

#messageObject



23
24
25
26
27
28
29
30
31
# File 'app/lib/foreman_ansible_director/issues/warnings/no_resolution_candidate_for_role.rb', line 23

def message
  <<~MESSAGE
    No resolution candidate was found for the following Ansible role:
    Role namespace: #{@role_namespace}
    Role name: #{@role_name}
    Ensure the lifecycle environment #{@content_source.cs_name} supplies this role,
    otherwise it will be skipped.
  MESSAGE
end

#render_for_responseObject



33
34
35
# File 'app/lib/foreman_ansible_director/issues/warnings/no_resolution_candidate_for_role.rb', line 33

def render_for_response
  super.merge({ assignment_id: @assignment_id })
end

#titleObject



18
19
20
21
# File 'app/lib/foreman_ansible_director/issues/warnings/no_resolution_candidate_for_role.rb', line 18

def title
  fqrn = "#{@role_namespace}.#{@role_name}"
  "No resolution candidate for Ansible role: \"#{fqrn}\""
end